Example #1
0
 static OutMessage query(
     DBCollection collection,
     int options,
     int numToSkip,
     int batchSize,
     DBObject query,
     DBObject fields,
     ReadPreference readPref) {
   return query(
       collection,
       options,
       numToSkip,
       batchSize,
       query,
       fields,
       readPref,
       DefaultDBEncoder.FACTORY.create());
 }
Example #2
0
 /**
  * Executes a database command. This method calls {@link DB#command(com.mongodb.DBObject, int,
  * com.mongodb.ReadPreference, com.mongodb.DBEncoder) } with a default encoder.
  *
  * @param cmd {@code DBObject} representation the command to be executed
  * @param options query options to use
  * @param readPrefs {@link ReadPreference} for this command (nodes selection is the biggest part
  *     of this)
  * @return result of the command execution
  * @throws MongoException
  * @dochub commands
  */
 public CommandResult command(DBObject cmd, int options, ReadPreference readPrefs) {
   return command(cmd, options, readPrefs, DefaultDBEncoder.FACTORY.create());
 }