简体   繁体   中英

DerbyJS Find Record from collection

I wand to get record from collection

var query=model.query('sales.dept',{price:100});
model.subscribe(query,function(err,bun)
{
       var data= query.ref('+page.sales').get();
         //its return empty array
          console.log(data);
});

The problem might be query.ref('+page.sales') , you probably want something like query.ref('_page.sales') instead.

Try the following, and make sure that you have added data to the collection.

var query = model.query('sales.dept',{price:100});
query.subscribe(function(err) {
   query.ref('_page.sales');
   console.log('Data', query.get());
});

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM