Example usage for com.mongodb QueryOperators GT

List of usage examples for com.mongodb QueryOperators GT

Introduction

In this page you can find the example usage for com.mongodb QueryOperators GT.

Prototype

String GT

To view the source code for com.mongodb QueryOperators GT.

Click Source Link

Usage

From source file:org.tinygroup.mongodb.engine.comparemode.impl.GreaterThanCompareMode.java

License:GNU General Public License

public BSONObject generateBSONObject(String propertyName, Object value, Context context) {
    return new BasicDBObject(propertyName, new BasicDBObject(QueryOperators.GT, value));
}

From source file:org.tinygroup.mongodb.engine.comparemode.impl.NotBetweenAndCompareMode.java

License:GNU General Public License

public BSONObject generateBSONObject(String propertyName, Object value, Context context) {
    if (value != null && value.getClass().isArray()) {
        BSONObject object = new BasicDBObject();
        Object[] array = (Object[]) value;
        if (array.length == 2) {
            object.put(QueryOperators.GT, array[0]);
            object.put(QueryOperators.LT, array[1]);
        }//from  w  w w .  ja v a2s.  c om
        return new BasicDBObject(propertyName, new BasicDBObject(QueryOperators.NE, object));
    }
    return null;
}