thewei / react-native-store

A simple database base on react-native AsyncStorage.
https://github.com/thewei/react-native-store
Other
569 stars 74 forks source link

add more meta info to find API response #17

Closed chandu0101 closed 8 years ago

chandu0101 commented 9 years ago

currently find API returning only array of objects

find({ limit : 10}) // [1..10 objects]

it will be cool if it adds more meta info like

{ total : 100 ,rows : [1..10] }
kintsugi commented 9 years ago

While not exactly the same, you can get the total number of rows like this from an arbitrary model userModel

var reactNativeStore = require('react-native-store');
var userModel = reactNativeStore.model('userModel');
var totalRows = userModel.model.totalRows;
thewei commented 9 years ago

Yes,you can write new api base on react-native-store's api.

chandu0101 commented 9 years ago

While not exactly the same, you can get the total number of rows like this from an arbitrary model userModel

but it doesn't solve all cases for example filter and paginate ..

Yes,you can write new api base on react-native-store's api.

Currently i am doing something similar hack in my scala.js code , it will be cool if its supported out of box in future :)