private void writeQuery(final DBObject fields, final int numToSkip, final int batchSize) { writeInt(_queryOptions); writeCString(_collection.getFullName()); writeInt(numToSkip); writeInt(batchSize); putObject(_query); if (fields != null) putObject(fields); }
private void writeUpdate( final boolean upsert, final boolean multi, final DBObject query, final DBObject o) { writeInt(0); // reserved writeCString(_collection.getFullName()); int flags = 0; if (upsert) flags |= 1; if (multi) flags |= 2; writeInt(flags); putObject(query); putObject(o); }
private void writeRemove() { writeInt(0); // reserved writeCString(_collection.getFullName()); Collection<String> keys = _query.keySet(); if (keys.size() == 1 && keys.iterator().next().equals("_id") && _query.get(keys.iterator().next()) instanceof ObjectId) writeInt(1); else writeInt(0); putObject(_query); }