Giter Site home page Giter Site logo

Comments (3)

knadh avatar knadh commented on June 24, 2024

Please show more of your code.

from localstoragedb.

changtung avatar changtung commented on June 24, 2024
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.

changtung avatar changtung commented on June 24, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.