src/back/MongoAdapter.js
function _buildCursor(db, EntityClass, query) {
  // copy query to not mess with user's object
  query = objects.copy(query);

  // rename id field
  if (query.hasOwnProperty('id')) {
    query._id = query.id;
    delete query.id;
  }

  // find collection name
  var name = getEntityCollectionName(EntityClass);

  // build cursor
  return db.collection(name).find(query);
}
function _buildCursor(db, EntityClass, query) {
  // copy query to not mess with user's object
  query = objects.copy(query);

  // rename id field
  if (query.hasOwnProperty('id')) {
    query._id = query.id;
    delete query.id;
  }

  // find collection name
  var name = getEntityCollectionName(EntityClass);

  // build cursor
  return db.collection(name).find(query);
}
function _buildCursor ( db , EntityClass , query ) { // copy query to not mess with user's object query = objects . copy ( query ) ; // rename id field if ( query . hasOwnProperty ( 'id' ) ) { query . _id = query . id ; delete query . id ; } // find collection name var name = getEntityCollectionName ( EntityClass ) ; // build cursor return db . collection ( name ) . find ( query ) ; }
Creates the DB Cursor, which iterates within the results from a query
@name module:back4app-entity-mongodb.MongoAdapter~_buildCursor
@function
@param {!module:mongodb/Db} db Db instance from MongoDB Driver.
@param {!module:back4app-entity/models.Entity} entityObject The Entity Class
which instance will be searched within the collections.
@param {?Object} query Object for query search.
@returns {module:mongodb/Cursor} MongoDB Cursor instance pointing to results
based on a query.
@private
@example
var cursor = _buildCursor(db, EntityClass, query);
Creates the DB Cursor which iterates within the results from a query