DATADOC-30 updated documenation
This commit is contained in:
@@ -355,39 +355,51 @@ public class AppConfig {
|
|||||||
|
|
||||||
<itemizedlist>
|
<itemizedlist>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>MongoTemplate(Mongo mongo, String databaseName) - takes the
|
<para><emphasis
|
||||||
default database name to operate against</para>
|
role="bold">MongoTemplate</emphasis><literal>(Mongo mongo, String
|
||||||
|
databaseName)</literal> - takes the default database name to
|
||||||
|
operate against</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>MongoTemplate(Mongo mongo, String databaseName, String
|
<para><emphasis
|
||||||
defaultCollectionName) - adds the default collection name to
|
role="bold">MongoTemplate</emphasis><literal>(Mongo mongo, String
|
||||||
operate against.</para>
|
databaseName, String defaultCollectionName)</literal> - adds the
|
||||||
|
default collection name to operate against.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>MongoTemplate(Mongo mongo, String databaseName, String
|
<para><emphasis
|
||||||
defaultCollectionName, MongoConverter mongoConverter) - override
|
role="bold">MongoTemplate</emphasis><literal>(Mongo mongo, String
|
||||||
with a provided MongoConverter. Default is
|
databaseName, String defaultCollectionName, MongoConverter
|
||||||
SimpleMongoConverter</para>
|
mongoConverter)</literal> - override with a provided
|
||||||
|
MongoConverter. Default is SimpleMongoConverter</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>MongoTemplate(Mongo mongo, String databaseName, String
|
<para><emphasis
|
||||||
defaultCollectionName, MongoConverter mongoConverter, WriteConcern
|
role="bold">MongoTemplate</emphasis><literal>(Mongo mongo, String
|
||||||
writeConcern, WriteResultChecking writeResultChecking) - Specify a
|
databaseName, String defaultCollectionName, MongoConverter
|
||||||
default WriteConcern and also WriteResultChecking policy</para>
|
mongoConverter, WriteConcern writeConcern, WriteResultChecking
|
||||||
|
writeResultChecking)</literal> - Specify a default WriteConcern
|
||||||
|
and also WriteResultChecking policy</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>MongoTemplate(Mongo mongo, String databaseName, String
|
<para><emphasis
|
||||||
defaultCollectionName, WriteConcern writeConcern,
|
role="bold">MongoTemplate</emphasis><literal>(Mongo mongo, String
|
||||||
WriteResultChecking writeResultChecking)</para>
|
databaseName, String defaultCollectionName, WriteConcern
|
||||||
|
writeConcern, WriteResultChecking writeResultChecking)</literal>-
|
||||||
|
Specify a default WriteConcern and also WriteResultChecking
|
||||||
|
policy</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>MongoTemplate(Mongo mongo, String databaseName, WriteConcern
|
<para><emphasis
|
||||||
writeConcern, WriteResultChecking writeResultChecking)</para>
|
role="bold">MongoTemplate</emphasis><literal>(Mongo mongo, String
|
||||||
|
databaseName, WriteConcern writeConcern, WriteResultChecking
|
||||||
|
writeResultChecking)</literal>- Specify a default WriteConcern and
|
||||||
|
also WriteResultChecking policy</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</itemizedlist>
|
</itemizedlist>
|
||||||
|
|
||||||
@@ -421,53 +433,60 @@ public class AppConfig {
|
|||||||
|
|
||||||
<para><itemizedlist>
|
<para><itemizedlist>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>Set<String> getCollectionNames() A set of collection
|
<para><literal>Set<String></literal> <emphasis
|
||||||
names.</para>
|
role="bold">getCollectionNames</emphasis><literal>()</literal> A
|
||||||
|
set of collection names.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>boolean collectionExists(java.lang.String collectionName)
|
<para><literal>boolean</literal> <emphasis
|
||||||
Check to see if a collection with a given name exists.</para>
|
role="bold">collectionExists</emphasis><literal>(String
|
||||||
|
collectionName)</literal> Check to see if a collection with a
|
||||||
|
given name exists.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>com.mongodb.DBCollection createCollection(String
|
<para><literal>DBCollection</literal> <emphasis
|
||||||
collectionName) Create an uncapped collection with the provided
|
role="bold">createCollection</emphasis><literal>(String
|
||||||
|
collectionName)</literal> Create an uncapped collection with the
|
||||||
|
provided name.</para>
|
||||||
|
</listitem>
|
||||||
|
|
||||||
|
<listitem>
|
||||||
|
<para><literal>DBCollection</literal> <emphasis
|
||||||
|
role="bold">createCollection</emphasis><literal>(String
|
||||||
|
collectionName, CollectionOptions collectionOptions)</literal>
|
||||||
|
Create a collect with the provided name and options.</para>
|
||||||
|
</listitem>
|
||||||
|
|
||||||
|
<listitem>
|
||||||
|
<para><literal>void</literal> <emphasis
|
||||||
|
role="bold">dropCollection</emphasis><literal>(String
|
||||||
|
collectionName)</literal> Drop the collection with the given
|
||||||
name.</para>
|
name.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>com.mongodb.DBCollection createCollection(String
|
<para><literal>DBCollection</literal> <emphasis
|
||||||
collectionName, CollectionOptions collectionOptions) Create a
|
role="bold">getCollection</emphasis><literal>(String
|
||||||
collect with the provided name and options.</para>
|
collectionName)</literal> Get a collection by name, creating it
|
||||||
|
if it doesn't exist.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>void dropCollection(java.lang.String collectionName) Drop
|
<para><literal>DBCollection</literal> <emphasis
|
||||||
the collection with the given name.</para>
|
role="bold">getDefaultCollection</emphasis><literal>()</literal>
|
||||||
|
The default collection used by this template.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>com.mongodb.DBCollection getCollection(java.lang.String
|
<para><literal>String</literal> <emphasis
|
||||||
collectionName) Get a collection by name, creating it if it
|
role="bold">getDefaultCollectionName</emphasis><literal>()</literal>
|
||||||
doesn't exist.</para>
|
The default collection name used by this template.</para>
|
||||||
</listitem>
|
|
||||||
|
|
||||||
<listitem>
|
|
||||||
<para>com.mongodb.DBCollection getDefaultCollection() The
|
|
||||||
default collection used by this template.</para>
|
|
||||||
</listitem>
|
|
||||||
|
|
||||||
<listitem>
|
|
||||||
<para>String getDefaultCollectionName() The default collection
|
|
||||||
name used by this template.</para>
|
|
||||||
</listitem>
|
|
||||||
|
|
||||||
<listitem>
|
|
||||||
<para>com.mongodb.DBCollection getDefaultCollection() The
|
|
||||||
default collection used by this template.</para>
|
|
||||||
</listitem>
|
</listitem>
|
||||||
</itemizedlist></para>
|
</itemizedlist></para>
|
||||||
|
|
||||||
|
<para></para>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section>
|
<section>
|
||||||
@@ -475,41 +494,50 @@ public class AppConfig {
|
|||||||
|
|
||||||
<para><itemizedlist>
|
<para><itemizedlist>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>com.mongodb.CommandResult
|
<para><literal>CommandResult</literal> <emphasis
|
||||||
executeCommand(com.mongodb.DBObject command) Execute a MongoDB
|
role="bold">executeCommand</emphasis><literal>(DBObject
|
||||||
command.</para>
|
command)</literal> Execute a MongoDB command.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>com.mongodb.CommandResult executeCommand(String
|
<para><literal>CommandResult</literal> <emphasis
|
||||||
jsonCommand) Execute the a MongoDB command expressed as a JSON
|
role="bold">executeCommand</emphasis><literal>(String
|
||||||
string.</para>
|
jsonCommand)</literal> Execute the a MongoDB command expressed
|
||||||
|
as a JSON string.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para><T> T execute(CollectionCallback<T> action)
|
<para><literal><T> T</literal> <emphasis
|
||||||
Executes the given CollectionCallback on the default
|
role="bold">execute</emphasis><literal>(CollectionCallback<T>
|
||||||
collection.</para>
|
action)</literal> Executes the given CollectionCallback on the
|
||||||
|
default collection.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para><T> T execute(CollectionCallback<T> action,
|
<para><literal><T> T</literal> <emphasis
|
||||||
String collectionName) Executes the given CollectionCallback on
|
role="bold">execute</emphasis><literal>(String collectionName,
|
||||||
the collection of the given name.</para>
|
CollectionCallback<T> action)</literal> Executes the given
|
||||||
|
CollectionCallback on the collection of the given name.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para><T> T execute(DbCallback<T> action) Executes a
|
<para><literal><T> T</literal> <emphasis
|
||||||
DbCallback translating any exceptions as necessary.</para>
|
role="bold">execute</emphasis><literal>(DbCallback<T>
|
||||||
|
action)</literal> Executes a DbCallback translating any
|
||||||
|
exceptions as necessary.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para><T> T executeInSession(DbCallback<T> action)
|
<para><literal><T> T</literal> <emphasis
|
||||||
Executes the given DbCallback within the same connection to the
|
role="bold">executeInSession</emphasis><literal>(DbCallback<T>
|
||||||
database so as to ensure consistency in a write heavy
|
action)</literal> Executes the given DbCallback within the same
|
||||||
environment where you may read the data that you wrote.</para>
|
connection to the database so as to ensure consistency in a
|
||||||
|
write heavy environment where you may read the data that you
|
||||||
|
wrote.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</itemizedlist></para>
|
</itemizedlist></para>
|
||||||
|
|
||||||
|
<para></para>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section>
|
<section>
|
||||||
@@ -517,17 +545,22 @@ public class AppConfig {
|
|||||||
|
|
||||||
<para><itemizedlist>
|
<para><itemizedlist>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>void ensureIndex(IndexSpecification indexSpecification)
|
<para><literal>void</literal> <emphasis
|
||||||
Ensure that an index for the provided IndexSpecification exists
|
role="bold">ensureIndex</emphasis><literal>(IndexDefinition
|
||||||
for the default collection.</para>
|
indexDefintion)</literal> Ensure that an index for the provided
|
||||||
|
IndexDefinition exists for the default collection.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>void ensureIndex(String collectionName, IndexSpecification
|
<para><literal>void</literal> <emphasis
|
||||||
indexSpecification) Ensure that an index for the provided
|
role="bold">ensureIndex</emphasis><literal>(String
|
||||||
IndexSpecification exists.</para>
|
collectionName, IndexDefinition indexSpecification)</literal>
|
||||||
|
Ensure that an index for the provided IndexDefinition
|
||||||
|
exists.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</itemizedlist></para>
|
</itemizedlist></para>
|
||||||
|
|
||||||
|
<para></para>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section>
|
<section>
|
||||||
@@ -535,55 +568,69 @@ public class AppConfig {
|
|||||||
|
|
||||||
<para><itemizedlist>
|
<para><itemizedlist>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>void insert(java.lang.Object objectToSave) Insert the
|
<para><literal>void</literal> <emphasis
|
||||||
object into the default collection.</para>
|
role="bold">insert</emphasis><literal>(Object
|
||||||
|
objectToSave)</literal> Insert the object into the default
|
||||||
|
collection.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>void insert(java.lang.String collectionName,
|
<para><literal>void</literal> <emphasis
|
||||||
java.lang.Object objectToSave) Insert the object into the
|
role="bold">insert</emphasis><literal>(String collectionName,
|
||||||
|
Object objectToSave)</literal> Insert the object into the
|
||||||
specified collection.</para>
|
specified collection.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>void insertList(java.util.List<? extends
|
<para><literal>void</literal> <emphasis
|
||||||
java.lang.Object> listToSave) Insert a list of objects into
|
role="bold">insertList</emphasis><literal>(List<? extends
|
||||||
|
Object> listToSave)</literal> Insert a list of objects into
|
||||||
the default collection in a single batch write to the
|
the default collection in a single batch write to the
|
||||||
database.</para>
|
database.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>void insertList(java.lang.String collectionName,
|
<para><literal>void</literal> <emphasis
|
||||||
java.util.List<? extends java.lang.Object> listToSave)
|
role="bold">insertList</emphasis><literal>(String
|
||||||
Insert a list of objects into the specified collection in a
|
collectionName, List<? extends Object>
|
||||||
single batch write to the database.</para>
|
listToSave)</literal> Insert a list of objects into the
|
||||||
|
specified collection in a single batch write to the
|
||||||
|
database.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para><T> void insert(T objectToSave, MongoWriter<T>
|
<para><literal><T> void</literal> <emphasis
|
||||||
writer) Insert the object into the default collection.</para>
|
role="bold">insert</emphasis><literal>(T objectToSave,
|
||||||
|
MongoWriter<T> writer)</literal> Insert the object into
|
||||||
|
the default collection.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para><T> void insert(String collectionName, T
|
<para><literal><T> void</literal> <emphasis
|
||||||
objectToSave, MongoWriter<T> writer) Insert the object
|
role="bold">insert</emphasis><literal>(String collectionName, T
|
||||||
into the specified collection.</para>
|
objectToSave, MongoWriter<T> writer)</literal> Insert the
|
||||||
|
object into the specified collection.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para><T> void insertList(List<? extends T>
|
<para><literal><T> void</literal> <emphasis
|
||||||
listToSave, MongoWriter<T> writer) Insert a list of
|
role="bold">insertList</emphasis><literal>(List<? extends
|
||||||
objects into the default collection using the provided
|
T> listToSave, MongoWriter<T> writer)</literal> Insert
|
||||||
|
a list of objects into the default collection using the provided
|
||||||
MongoWriter instance</para>
|
MongoWriter instance</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para><T> void insertList(String collectionName, List<?
|
<para><literal><T> void</literal> <emphasis
|
||||||
extends T> listToSave, MongoWriter<T> writer) Insert a
|
role="bold">insertList</emphasis><literal>(String
|
||||||
list of objects into the specified collection using the provided
|
collectionName, List<? extends T> listToSave,
|
||||||
MongoWriter instance</para>
|
MongoWriter<T> writer)</literal> Insert a list of objects
|
||||||
|
into the specified collection using the provided MongoWriter
|
||||||
|
instance</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</itemizedlist></para>
|
</itemizedlist></para>
|
||||||
|
|
||||||
|
<para></para>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section>
|
<section>
|
||||||
@@ -591,87 +638,106 @@ public class AppConfig {
|
|||||||
|
|
||||||
<para><itemizedlist>
|
<para><itemizedlist>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para><T> List<T> getCollection(Class<T>
|
<para><literal><T> List<T></literal> <emphasis
|
||||||
targetClass) Query for a list of objects of type T from the
|
role="bold">getCollection</emphasis><literal>(Class<T>
|
||||||
default collection.</para>
|
targetClass)</literal> Query for a list of objects of type T
|
||||||
|
from the default collection.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para><T> List<T> getCollection(String
|
<para><literal><T> List<T></literal> <emphasis
|
||||||
collectionName, Class<T> targetClass) Query for a list of
|
role="bold">getCollection</emphasis><literal>(String
|
||||||
objects of type T from the specified collection.</para>
|
collectionName, Class<T> targetClass)</literal> Query for
|
||||||
|
a list of objects of type T from the specified
|
||||||
|
collection.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para><T> List<T> getCollection(String
|
<para><literal><T> List<T></literal> <emphasis
|
||||||
|
role="bold">getCollection</emphasis><literal>(String
|
||||||
collectionName, Class<T> targetClass, MongoReader<T>
|
collectionName, Class<T> targetClass, MongoReader<T>
|
||||||
reader) Query for a list of objects of type T from the specified
|
reader)</literal> Query for a list of objects of type T from the
|
||||||
collection, mapping the DBObject using the provided
|
specified collection, mapping the DBObject using the provided
|
||||||
MongoReader.</para>
|
MongoReader.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para><T> T findOne(Query query, Class<T>
|
<para><literal><T> T</literal> <emphasis
|
||||||
targetClass) Map the results of an ad-hoc query on the default
|
role="bold">findOne</emphasis><literal>(Query query,
|
||||||
MongoDB collection to a single instance of an object of the
|
Class<T> targetClass)</literal> Map the results of an
|
||||||
specified type.</para>
|
|
||||||
</listitem>
|
|
||||||
|
|
||||||
<listitem>
|
|
||||||
<para><T> T findOne(Query query, Class<T>
|
|
||||||
targetClass, MongoReader<T> reader) Map the results of an
|
|
||||||
ad-hoc query on the default MongoDB collection to a single
|
ad-hoc query on the default MongoDB collection to a single
|
||||||
instance of an object of the specified type.</para>
|
instance of an object of the specified type.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para><T> T findOne(java.lang.String collectionName, Query
|
<para><literal><T> T</literal> <emphasis
|
||||||
query, Class<T> targetClass) Map the results of an ad-hoc
|
role="bold">findOne</emphasis><literal>(Query query,
|
||||||
query on the specified collection to a single instance of an
|
Class<T> targetClass, MongoReader<T>
|
||||||
object of the specified type.</para>
|
reader)</literal> Map the results of an ad-hoc query on the
|
||||||
|
default MongoDB collection to a single instance of an object of
|
||||||
|
the specified type.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para><T> T findOne(java.lang.String collectionName, Query
|
<para><literal><T> T</literal> <emphasis
|
||||||
query, Class<T> targetClass, MongoReader<T> reader)
|
role="bold">findOne</emphasis><literal>(java.lang.String
|
||||||
Map the results of an ad-hoc query on the specified collection
|
collectionName, Query query, Class<T>
|
||||||
to a single instance of an object of the specified type.</para>
|
targetClass)</literal> Map the results of an ad-hoc query on the
|
||||||
</listitem>
|
specified collection to a single instance of an object of the
|
||||||
|
|
||||||
<listitem>
|
|
||||||
<para><T> List<T> find(Query query, Class<T>
|
|
||||||
targetClass) Map the results of an ad-hoc query on the default
|
|
||||||
MongoDB collection to a List of the specified type.</para>
|
|
||||||
</listitem>
|
|
||||||
|
|
||||||
<listitem>
|
|
||||||
<para><T> List<T> find(Query query, Class<T>
|
|
||||||
targetClass, MongoReader<T> reader) Map the results of an
|
|
||||||
ad-hoc query on the default MongoDB collection to a List of the
|
|
||||||
specified type.</para>
|
specified type.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para><T> List<T> find(String collectionName, Query
|
<para><literal><T> T</literal> <emphasis
|
||||||
query, Class<T> targetClass) Map the results of an ad-hoc
|
role="bold">findOne</emphasis><literal>(java.lang.String
|
||||||
query on the specified collection to a List of the specified
|
collectionName, Query query, Class<T> targetClass,
|
||||||
|
MongoReader<T> reader)</literal> Map the results of an
|
||||||
|
ad-hoc query on the specified collection to a single instance of
|
||||||
|
an object of the specified type.</para>
|
||||||
|
</listitem>
|
||||||
|
|
||||||
|
<listitem>
|
||||||
|
<para><literal><T> List<T></literal> <emphasis
|
||||||
|
role="bold">find</emphasis><literal>(Query query, Class<T>
|
||||||
|
targetClass)</literal> Map the results of an ad-hoc query on the
|
||||||
|
default MongoDB collection to a List of the specified
|
||||||
type.</para>
|
type.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para><T> List<T> find(String collectionName, Query
|
<para><literal><T> List<T></literal> <emphasis
|
||||||
query, Class<T> targetClass, CursorPreparer preparer) Map
|
role="bold">find</emphasis><literal>(Query query, Class<T>
|
||||||
the results of an ad-hoc query on the specified collection to a
|
targetClass, MongoReader<T> reader)</literal> Map the
|
||||||
List of the specified type.</para>
|
results of an ad-hoc query on the default MongoDB collection to
|
||||||
|
a List of the specified type.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para><T> List<T> find(String collectionName, Query
|
<para><literal><T> List<T></literal> <emphasis
|
||||||
query, Class<T> targetClass, MongoReader<T> reader)
|
role="bold">find</emphasis><literal>(String collectionName,
|
||||||
Map the results of an ad-hoc query on the specified collection
|
Query query, Class<T> targetClass)</literal> Map the
|
||||||
to a List of the specified type.</para>
|
results of an ad-hoc query on the specified collection to a List
|
||||||
|
of the specified type.</para>
|
||||||
|
</listitem>
|
||||||
|
|
||||||
|
<listitem>
|
||||||
|
<para><literal><T> List<T></literal> <emphasis
|
||||||
|
role="bold">find</emphasis><literal>(String collectionName,
|
||||||
|
Query query, Class<T> targetClass, CursorPreparer
|
||||||
|
preparer)</literal> Map the results of an ad-hoc query on the
|
||||||
|
specified collection to a List of the specified type.</para>
|
||||||
|
</listitem>
|
||||||
|
|
||||||
|
<listitem>
|
||||||
|
<para><literal><T> List<T></literal> <emphasis
|
||||||
|
role="bold">find</emphasis><literal>(String collectionName,
|
||||||
|
Query query, Class<T> targetClass, MongoReader<T>
|
||||||
|
reader)</literal> Map the results of an ad-hoc query on the
|
||||||
|
specified collection to a List of the specified type.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</itemizedlist></para>
|
</itemizedlist></para>
|
||||||
|
|
||||||
|
<para></para>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section>
|
<section>
|
||||||
@@ -679,27 +745,36 @@ public class AppConfig {
|
|||||||
|
|
||||||
<para><itemizedlist>
|
<para><itemizedlist>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>void save(Object objectToSave) Save the object to the
|
<para><literal>void</literal> <emphasis
|
||||||
default collection.</para>
|
role="bold">save</emphasis><literal>(Object
|
||||||
|
objectToSave)</literal> Save the object to the default
|
||||||
|
collection.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>void save(String collectionName, Object objectToSave) Save
|
<para><literal>void</literal> <emphasis
|
||||||
the object to the specified collection.</para>
|
role="bold">save</emphasis><literal>(String collectionName,
|
||||||
|
Object objectToSave)</literal> Save the object to the specified
|
||||||
|
collection.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para><T> void save(T objectToSave, MongoWriter<T>
|
<para><literal><T> void</literal> <emphasis
|
||||||
writer) Save the object into the default collection using the
|
role="bold">save</emphasis><literal>(T objectToSave,
|
||||||
provided writer.</para>
|
MongoWriter<T> writer)</literal> Save the object into the
|
||||||
|
default collection using the provided writer.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para><T> void save(String collectionName, T objectToSave,
|
<para><literal><T> void</literal> <emphasis
|
||||||
MongoWriter<T> writer) Save the object into the specified
|
role="bold">save</emphasis><literal>(String collectionName, T
|
||||||
collection using the provided writer.</para>
|
objectToSave, MongoWriter<T> writer)</literal> Save the
|
||||||
|
object into the specified collection using the provided
|
||||||
|
writer.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</itemizedlist></para>
|
</itemizedlist></para>
|
||||||
|
|
||||||
|
<para></para>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section>
|
<section>
|
||||||
@@ -707,17 +782,22 @@ public class AppConfig {
|
|||||||
|
|
||||||
<para><itemizedlist>
|
<para><itemizedlist>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>void remove(Query query) Remove all documents from the
|
<para><literal>void</literal> <emphasis
|
||||||
default collection that match the provided query document
|
role="bold">remove</emphasis><literal>(Query query)</literal>
|
||||||
criteria.</para>
|
Remove all documents from the default collection that match the
|
||||||
|
provided query document criteria.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>void remove(String collectionName, Query query) Remove all
|
<para><literal>void</literal> <emphasis
|
||||||
documents from the specified collection that match the provided
|
role="bold">remove</emphasis><literal>(String collectionName,
|
||||||
query document criteria.</para>
|
Query query)</literal> Remove all documents from the specified
|
||||||
|
collection that match the provided query document
|
||||||
|
criteria.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</itemizedlist></para>
|
</itemizedlist></para>
|
||||||
|
|
||||||
|
<para></para>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section>
|
<section>
|
||||||
@@ -725,33 +805,41 @@ public class AppConfig {
|
|||||||
|
|
||||||
<para><itemizedlist>
|
<para><itemizedlist>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para> com.mongodb.WriteResult updateFirst(Query query, Update
|
<para> <literal>WriteResult</literal> <emphasis
|
||||||
update) Updates the first object that is found in the default
|
role="bold">updateFirst</emphasis><literal>(Query query, Update
|
||||||
collection that matches the query document with the provided
|
update)</literal> Updates the first object that is found in the
|
||||||
updated document.</para>
|
default collection that matches the query document with the
|
||||||
</listitem>
|
|
||||||
|
|
||||||
<listitem>
|
|
||||||
<para>com.mongodb.WriteResult updateFirst(String collectionName,
|
|
||||||
Query query, Update update) Updates the first object that is
|
|
||||||
found in the specified collection that matches the query
|
|
||||||
document criteria with the provided updated document.</para>
|
|
||||||
</listitem>
|
|
||||||
|
|
||||||
<listitem>
|
|
||||||
<para>com.mongodb.WriteResult updateMulti(Query query, Update
|
|
||||||
update) Updates all objects that are found in the default
|
|
||||||
collection that matches the query document criteria with the
|
|
||||||
provided updated document.</para>
|
provided updated document.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>com.mongodb.WriteResult updateMulti(String collectionName,
|
<para><literal>WriteResult</literal> <emphasis
|
||||||
Query query, Update update) Updates all objects that are found
|
role="bold">updateFirst</emphasis><literal>(String
|
||||||
in the specified collection that matches the query document
|
collectionName, Query query, Update update)</literal> Updates
|
||||||
criteria with the provided updated document.</para>
|
the first object that is found in the specified collection that
|
||||||
|
matches the query document criteria with the provided updated
|
||||||
|
document.</para>
|
||||||
|
</listitem>
|
||||||
|
|
||||||
|
<listitem>
|
||||||
|
<para><literal>WriteResult</literal> <emphasis
|
||||||
|
role="bold">updateMulti</emphasis><literal>(Query query, Update
|
||||||
|
update)</literal> Updates all objects that are found in the
|
||||||
|
default collection that matches the query document criteria with
|
||||||
|
the provided updated document.</para>
|
||||||
|
</listitem>
|
||||||
|
|
||||||
|
<listitem>
|
||||||
|
<para><literal>WriteResult</literal> <emphasis
|
||||||
|
role="bold">updateMulti</emphasis><literal>(String
|
||||||
|
collectionName, Query query, Update update)</literal> Updates
|
||||||
|
all objects that are found in the specified collection that
|
||||||
|
matches the query document criteria with the provided updated
|
||||||
|
document.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</itemizedlist></para>
|
</itemizedlist></para>
|
||||||
|
|
||||||
|
<para></para>
|
||||||
</section>
|
</section>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
@@ -760,7 +848,7 @@ public class AppConfig {
|
|||||||
|
|
||||||
<para>It's time to look at some code examples showing how to use the
|
<para>It's time to look at some code examples showing how to use the
|
||||||
<classname>MongoTemplate</classname>. First we look at creating our
|
<classname>MongoTemplate</classname>. First we look at creating our
|
||||||
first colection.</para>
|
first collection.</para>
|
||||||
|
|
||||||
<example>
|
<example>
|
||||||
<title>Working with collections using the MongoTemplate</title>
|
<title>Working with collections using the MongoTemplate</title>
|
||||||
|
|||||||
Reference in New Issue
Block a user