DatabaseUser.query(dbId, params[, token])

Queries users from the database.


This method has the following parameters:

dbIdString with database id.
tokenString with user token.
paramsJSON object that contains request parameters.

JSON object params has the following structure:

   ["skip":<skip>, ]
   ["limit":<limit>, ]
   ["count":<count>, ]
   ["sort":<sort>, ]
   ["include":<include> ]

params JSON parameters:

criteriaJSONQuery object built in accordance with the mongo querying.
skipintegerParameter indicating how much objects should be skipped before including objects into response.
limitintegerParameter indicating how many objects should be included in response.
countbooleanParameter indicating whether the number of selected objects should be included in response.
sortstringList of fields names split by comma that indicates the order of objects in response.
includestringParameter that indicates whether the referenced object should be included.


JSON object with a list of users

   "username": <username > ,
   "_createdAt": <datetime > ,
   "_updatedAt": <datetime > ,
   "_id": <user_id >
}, ...]

Queryingusers from the database.

var dbId = "52776916a044652b54f1f976";
var username = "testUser10";
var password = "testUser10";
var token = DatabaseUser.login(dbId, username, password).sessionToken;

var query = DatabaseUser.query(dbId, {
    "skip": 1,
    "limit": 1
}, token);