Package com.mongodb

Examples of com.mongodb.DBCursor.hint()


                    }
                    if (limit > 0) {
                        cur.limit(limit);
                    }
                    if (hint != null) {
                        cur.hint(hint);
                    }
                    if (explain) {
                        return cur.explain();
                    }
View Full Code Here


                }
                if (limit > 0) {
                    cur.limit(limit);
                }
                if (hint != null) {
                    cur.hint(hint);
                }
                if (explain) {
                    return cur.explain();
                }
View Full Code Here

        if (snapshotted)
            cursor.snapshot();
        if (sort != null)
            cursor.sort(sort);
        if (indexHint != null)
            cursor.hint(indexHint);

        if (null != readPref) {
            cursor.setReadPreference(readPref);
        }
View Full Code Here

        if (query.getSortObject() != null) {
          DBObject sortDbo = type != null ? getMappedSortObject(query, type) : query.getSortObject();
          cursorToUse = cursorToUse.sort(sortDbo);
        }
        if (StringUtils.hasText(query.getHint())) {
          cursorToUse = cursorToUse.hint(query.getHint());
        }
        if (query.getMeta().hasValues()) {
          for (Entry<String, Object> entry : query.getMeta().values()) {
            cursorToUse = cursorToUse.addSpecial(entry.getKey(), entry.getValue());
          }
View Full Code Here

        DBCursor cursor = oplogCollection.find(indexFilter).setOptions(options);

        // Toku sometimes gets stuck without this hint:
        if (indexFilter.containsField(MongoDBRiver.MONGODB_ID_FIELD)) {
            cursor = cursor.hint("_id_");
        }
        isRiverStale(cursor, time);
        return cursor;
    }
View Full Code Here

        }
        if (sort != null) {
            cursor.sort(sort);
        }
        if (indexHint != null) {
            cursor.hint(indexHint);
        }

        if (null != readPref) {
            cursor.setReadPreference(readPref);
        }
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.