Comments (3)
Please show more of your code.
from localstoragedb.
function fillB(d) {
for ( var i = 0 ; i < d.length ; i++ )
{
var user_id = d[i].user_id;
var u_arr = lib.queryAll("users",{
query: {ID:user_id}
});
d[i] = u_arr[0];
$log.debug('ref1,reef2',d[i],u_arr[0]);
}
return d;
}
first code somehow is called, but i assume later.
here is declaration:
lib.createTable("d", ["user_id","pn","p"]);
lib.createTable("users", [
"bn",
"c"
(...10 more)
]];
and finally place where it happens:
var user = lib.queryAll("users",{
query: { username:user_info.username}
});
var d_arr2 = lib.queryAll("d",{
query: { user_id: '3'}
});
$log.debug('d(1):',d_arr2);
var t = lib.queryAll("d",{
query: function(row) {
if(row.user_id.toString() === user[0].ID.toString()) {
return true;
} else {
return false;
}
}
});
$log.debug('d(2):',t);
var t3 = lib.queryAll("d",{
});
$log.debug('d(3):',t3);
It's Angular 1.5.0 app and Google Chrome.
debugs d(1) and d(2) have users tables, but d(3) has d tables records( correct ).
I suppose it's something related to keeping in a memory pool until refresh, because i am writing to a variable a user variable and it may preserve.
from localstoragedb.
Problem was here:
d[i] = u_arr[0];
If i change to less good:
d[i].var1 = u_arr[0].var1;
Then it works.
from localstoragedb.
Related Issues (20)
- GroupBy SQL Query HOT 3
- queryAll query returns Cannot read property 'toString' of null HOT 3
- Not supporting cross-tabs HOT 3
- return false in queryAll HOT 1
- search values in array HOT 1
- Migrate database when update schema? HOT 1
- Is there NPM package for this? HOT 1
- I think the documentation is broken at Methods
- How to Drop Column with alterTable? HOT 2
- Do you intend to add the export import function?
- Updating NPM localstoragedb version HOT 1
- Update method removes ID from object by link
- Use in chrome Extensions ?
- Thank you
- my truncate not working HOT 1
- How can I delete that data when a value is zero? HOT 2
- How do I retrieve a value from local storage and set it in an HTML input field? HOT 1
- 如果超出大小限制的话,有提示吗?
- I don't know if there's a bug in localstoragedb.d.ts or if I'm using it wrong. HOT 2
- IndexedDB vs localStorageDB?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from localstoragedb.