Exemplo n.º 1
0
  @Test
  public void getCollection() {
    DBCollection collection = template.getCollection(false);
    assertEquals("simple", collection.getName());
    assertEquals(ReadPreference.PRIMARY, collection.getReadPreference());

    collection = template.getCollection(true);
    assertEquals(ReadPreference.SECONDARY, collection.getReadPreference());

    collection = template.getCollection();
    assertEquals(mds.getDb().getReadPreference(), collection.getReadPreference());
  }
Exemplo n.º 2
0
 @Override
 public MorphiaIterator<U, U> aggregate(final Class<U> target, final AggregationOptions options) {
   return aggregate(target, options, collection.getReadPreference());
 }
 SidistranDBCursor(DBCollection collection, Cursor cursor) {
   super(collection, null, null, collection.getReadPreference());
   this.__cursor = cursor;
 }
Exemplo n.º 4
0
 @Override
 public MorphiaIterator<U, U> aggregate(final Class<U> target) {
   return aggregate(target, AggregationOptions.builder().build(), collection.getReadPreference());
 }