Example usage for com.mongodb QueryOperators NE

List of usage examples for com.mongodb QueryOperators NE

Introduction

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

Prototype

String NE

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

Click Source Link

Usage

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

License:GNU General Public License

public BSONObject generateBSONObject(String propertyName, Object value, Context context) {
    Pattern pattern = Pattern.compile("^.*" + value + ".*$", Pattern.MULTILINE);
    BSONObject bsonObject = new BasicDBObject("$regex", pattern);
    return new BasicDBObject(propertyName, new BasicDBObject(QueryOperators.NE, bsonObject));
}

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

License:GNU General Public License

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