Examples of BasicDBObject


Examples of com.massivecraft.mcore.xlib.mongodb.BasicDBObject

public class JSONCallback extends BasicBSONCallback {

    @Override
    public BSONObject create() {
        return new BasicDBObject();
    }
View Full Code Here

Examples of com.mongodb.BasicDBObject

      String.class);
  }

  @Override
  public List<User> fetchUsers(int page, int pageSize) {
    DBObject orderBy = new BasicDBObject("_id", -1);
    int skip = page * pageSize;
    return usersCollection.find().sort(orderBy).skip(skip).limit(pageSize).toArray();
  }
View Full Code Here

Examples of com.mongodb.BasicDBObject

  }

  @Override
  public Optional<User> getBySessionToken(UUID sessionToken) {

    DBObject query = new BasicDBObject("sessionToken", sessionToken);
    User user = usersCollection.findOne(query);
    return Optional.fromNullable(user);
  }
View Full Code Here

Examples of com.mongodb.BasicDBObject

    return Optional.fromNullable(user);
  }

  @Override
  public Optional<User> getByOpenIDIdentifier(String openIDIdentifier) {
    DBObject query = new BasicDBObject("openIDIdentifier", openIDIdentifier);
    User user = usersCollection.findOne(query);
    return Optional.fromNullable(user);
  }
View Full Code Here

Examples of com.mongodb.BasicDBObject

    return Optional.fromNullable(user);
  }

  @Override
  public Optional<User> getByEmailAddress(String emailAddress) {
    DBObject query = new BasicDBObject("emailAddress", emailAddress);
    User user = usersCollection.findOne(query);
    return Optional.fromNullable(user);
  }
View Full Code Here

Examples of com.mongodb.BasicDBObject

      String.class);
  }

  @Override
  public List<SoilData> fetchNewestSoilData(int page, int pageSize) {
    DBObject orderBy = new BasicDBObject("_id", -1);
    int skip = page * pageSize;
    return soilDataCollection.find().sort(orderBy).skip(skip).limit(pageSize).toArray();
  }
View Full Code Here

Examples of com.mongodb.BasicDBObject

    mongodProcess = mongodExecutable.start();
    Mongo mongo = new Mongo("localhost", 12345);
    db = mongo.getDB(DATABASE_NAME);

    // Create collections
    db.createCollection("soilData", new BasicDBObject());

  }
View Full Code Here

Examples of com.mongodb.BasicDBObject

  @Test
  public void shouldCreateNewObjectInEmbeddedMongoDb() {

    // Given
    DBCollection col = db.createCollection("testCollection", new BasicDBObject());

    // When
    col.save(new BasicDBObject("testDoc", new Date()));

    // Then
    assertThat(col.getCount()).isEqualTo(1L);
  }
View Full Code Here

Examples of com.mongodb.BasicDBObject

            final boolean deleted = this.deletedResources.remove(path);
            final MongoDBResource oldResource = (MongoDBResource)this.getResource(resolver, path, info);
            if ( !deleted && oldResource != null ) {
                throw new PersistenceException("Resource already exists at " + path, null, path, null);
            }
            final DBObject dbObj = new BasicDBObject();
            dbObj.put(getPROP_PATH(), info[1]);
            if ( properties != null ) {
                for(Map.Entry<String, Object> entry : properties.entrySet()) {
                    final String key = propNameToKey(entry.getKey());
                    dbObj.put(key, entry.getValue());
                }
            }
            if ( deleted && oldResource != null ) {
                dbObj.put(PROP_ID, oldResource.getProperties().get(PROP_ID));
            }
            final MongoDBResource rsrc = new MongoDBResource(resolver, path, info[0], dbObj, this);
            this.changedResources.put(path, rsrc);

            return rsrc;
View Full Code Here

Examples of com.mongodb.BasicDBObject

    }
   
    World[] worlds = new World[queries];
    for (int i = 0; i < queries; i++) {
      DBObject object = database.getCollection("World").findOne(
          new BasicDBObject("_id", Helper.randomWorld()));
      worlds[i] = new World(
          //
          // The creation script for the Mongo database inserts these numbers as
          // JavaScript numbers, which resolve to Doubles in Java.
          //
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.