Example usage for com.mongodb DBCollection findAndRemove

List of usage examples for com.mongodb DBCollection findAndRemove

Introduction

In this page you can find the example usage for com.mongodb DBCollection findAndRemove.

Prototype

@Nullable
public DBObject findAndRemove(@Nullable final DBObject query) 

Source Link

Document

Atomically remove and return a single document.

Usage

From source file:rapture.sheet.mongodb.MongoCellStore.java

License:Open Source License

public Boolean deleteCell(String sheetName, int row, int column, int dimension) {
    DBCollection collection = MongoDBFactory.getDB(instanceName).getCollection(tableName);
    BasicDBObject query = new BasicDBObject();
    query.put(KEY, sheetName);//from  w w  w.j  a  va  2s.c o m
    query.put(ROW, row);
    query.put(COL, column);
    query.put(DIM, dimension);
    collection.findAndRemove(query);
    return true;
}