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());
});
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top