public class DefaultMongoTemplate extends AbstractMongoTemplate implements MongoTemplate
| Constructor and Description |
|---|
DefaultMongoTemplate(com.mongodb.MongoClient mongo)
Initialize a template for the given
mongoDb instance, using default database name ("axonframework")
and collection name ("sagas"). |
DefaultMongoTemplate(com.mongodb.MongoClient mongo,
String databaseName,
String sagasCollectionName)
Creates a template connecting to given
mongo instance, and loads sagas in the collection with given
sagasCollectionName, in a database with given databaseName. |
| Modifier and Type | Method and Description |
|---|---|
com.mongodb.client.MongoCollection<org.bson.Document> |
sagaCollection()
Returns a reference to the collection containing the saga instances.
|
databasepublic DefaultMongoTemplate(com.mongodb.MongoClient mongo)
mongoDb instance, using default database name ("axonframework")
and collection name ("sagas").mongo - The Mongo instance providing access to the databasepublic DefaultMongoTemplate(com.mongodb.MongoClient mongo,
String databaseName,
String sagasCollectionName)
mongo instance, and loads sagas in the collection with given
sagasCollectionName, in a database with given databaseName.mongo - The Mongo instance configured to connect to the Mongo ServerdatabaseName - The name of the database containing the datasagasCollectionName - The collection containing the saga instancepublic com.mongodb.client.MongoCollection<org.bson.Document> sagaCollection()
MongoTemplatesagaCollection in interface MongoTemplateCopyright © 2010–2017. All rights reserved.