Package com.massivecraft.mcore.xlib.mongodb

Examples of com.massivecraft.mcore.xlib.mongodb.BasicDBObject.containsField()


  public Long getMtime(Coll<?> coll, String id)
  {
    DBCollection dbcoll = fixColl(coll);
    BasicDBObject found = (BasicDBObject)dbcoll.findOne(new BasicDBObject(ID_FIELD, id), dboKeysMtime);
    if (found == null) return null;
    if ( ! found.containsField(MTIME_FIELD)) return null; // This should not happen! But better to ignore than crash?
    return found.getLong(MTIME_FIELD);
  }
 
  @Override
  public Collection<String> getIds(Coll<?> coll)
View Full Code Here


      ret = new HashMap<String, Long>(cursor.count());
      while(cursor.hasNext())
      {
        BasicDBObject raw = (BasicDBObject)cursor.next();
        Object remoteId = raw.get(ID_FIELD);
        if ( ! raw.containsField(MTIME_FIELD)) continue; // This should not happen! But better to ignore than crash?
        Long mtime = raw.getLong(MTIME_FIELD);
        ret.put(remoteId.toString(), mtime);
      }
    }
    finally
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.