// Path: src/main/java/com/lowereast/guiceymongo/data/DataWrapper.java
// public interface DataWrapper<T extends IsData> {
// 	T wrap(DBObject backing);
// }
// 
// Path: src/main/java/com/lowereast/guiceymongo/data/IsBuilder.java
// public interface IsBuilder<T extends IsData> {
// 	DBObject build();
// }
// 
// Path: src/main/java/com/lowereast/guiceymongo/data/IsData.java
// public interface IsData {
// }


import com.lowereast.guiceymongo.data.DataWrapper;
import com.lowereast.guiceymongo.data.IsBuilder;
import com.lowereast.guiceymongo.data.IsData;
import com.mongodb.*;
import java.util.List;
	public Item findAndRemove(DBObject query, DBObject sort) {
		DBObject command = new BasicDBObject("findandmodify", _collection.getName())
			.append("remove", true);
		if (query != null && !EMPTY.equals(query))
			command.put("query", query);
		if (sort != null && !EMPTY.equals(sort))
			command.put("sort", sort);
		
		DBObject result = _collection.getDB().command(command);
		if (1 == (Integer)result.get("ok"))
			return _wrapper.wrap((DBObject)result.get("value"));
		throw new MongoException((Integer)result.get("code"), (String)result.get("errmsg"));
	}
	
//	public GuiceyQuery.ExecutableCursorBuilder<Item> find() {
//		return GuiceyQuery.newExecutableCursorBuilder();
//	}
	
//	public GuiceyQuery.ExecutableCursorBuilder<Item> select(FieldSet fieldSet) {
//		return GuiceyQuery.newExecutableCursorBuilder(fieldSet);
//	}
	
	public void insert(DBObject item) {
		_collection.insert(item);
	}
	
	public void insert(DBObject[] items) {
		_collection.insert(items);
	}
	
// Path: src/main/java/com/lowereast/guiceymongo/data/DataWrapper.java
// public interface DataWrapper<T extends IsData> {
// 	T wrap(DBObject backing);
// }
// 
// Path: src/main/java/com/lowereast/guiceymongo/data/IsBuilder.java
// public interface IsBuilder<T extends IsData> {
// 	DBObject build();
// }
// 
// Path: src/main/java/com/lowereast/guiceymongo/data/IsData.java
// public interface IsData {
// }


// Path: src/main/java/com/lowereast/guiceymongo/GuiceyCollection.java
import com.lowereast.guiceymongo.data.DataWrapper;
import com.lowereast.guiceymongo.data.IsBuilder;
import com.lowereast.guiceymongo.data.IsData;
import com.mongodb.*;
import java.util.List;

	public Item findAndRemove(DBObject query, DBObject sort) {
		DBObject command = new BasicDBObject("findandmodify", _collection.getName())
			.append("remove", true);
		if (query != null && !EMPTY.equals(query))
			command.put("query", query);
		if (sort != null && !EMPTY.equals(sort))
			command.put("sort", sort);
		
		DBObject result = _collection.getDB().command(command);
		if (1 == (Integer)result.get("ok"))
			return _wrapper.wrap((DBObject)result.get("value"));
		throw new MongoException((Integer)result.get("code"), (String)result.get("errmsg"));
	}
	
//	public GuiceyQuery.ExecutableCursorBuilder<Item> find() {
//		return GuiceyQuery.newExecutableCursorBuilder();
//	}
	
//	public GuiceyQuery.ExecutableCursorBuilder<Item> select(FieldSet fieldSet) {
//		return GuiceyQuery.newExecutableCursorBuilder(fieldSet);
//	}
	
	public void insert(DBObject item) {
		_collection.insert(item);
	}
	
	public void insert(DBObject[] items) {
		_collection.insert(items);
	}
	
	public void insert(IsBuilder<Item> item) {