|
|
|
@ -29,6 +29,7 @@ public class MongoCollectionHelper {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Initialize the collection helper
|
|
|
|
|
*
|
|
|
|
|
* @param database Instance of {@link MongoConnectionHandler}
|
|
|
|
|
*/
|
|
|
|
|
public MongoCollectionHelper(@NotNull MongoConnectionHandler database) {
|
|
|
|
@ -37,6 +38,7 @@ public class MongoCollectionHelper {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Create a collection
|
|
|
|
|
*
|
|
|
|
|
* @param collectionName the collection name
|
|
|
|
|
*/
|
|
|
|
|
public void createCollection(@NotNull String collectionName) {
|
|
|
|
@ -45,6 +47,7 @@ public class MongoCollectionHelper {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Delete a collection
|
|
|
|
|
*
|
|
|
|
|
* @param collectionName the collection name
|
|
|
|
|
*/
|
|
|
|
|
public void deleteCollection(@NotNull String collectionName) {
|
|
|
|
@ -53,6 +56,7 @@ public class MongoCollectionHelper {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get a collection
|
|
|
|
|
*
|
|
|
|
|
* @param collectionName the collection name
|
|
|
|
|
* @return MongoCollection<Document>
|
|
|
|
|
*/
|
|
|
|
@ -62,6 +66,7 @@ public class MongoCollectionHelper {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Add a document to a collection
|
|
|
|
|
*
|
|
|
|
|
* @param collectionName collection to add to
|
|
|
|
|
* @param document Document to add
|
|
|
|
|
*/
|
|
|
|
@ -72,6 +77,7 @@ public class MongoCollectionHelper {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Update a document
|
|
|
|
|
*
|
|
|
|
|
* @param collectionName collection the document is in
|
|
|
|
|
* @param document filter of document
|
|
|
|
|
* @param updates Bson of updates
|
|
|
|
@ -83,6 +89,7 @@ public class MongoCollectionHelper {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Delete a document
|
|
|
|
|
*
|
|
|
|
|
* @param collectionName collection the document is in
|
|
|
|
|
* @param document filter to remove
|
|
|
|
|
*/
|
|
|
|
|