verify if field exists in mongodb code example
Example: mongodb check if field exists java
DBObject query;
query = new BasicDBObject("fields_name", new BasicDBObject("$exists", true));
DBCursor result = collection.find(query);
DBObject query;
query = new BasicDBObject("fields_name", new BasicDBObject("$exists", true));
DBCursor result = collection.find(query);