@@ -97,7 +97,7 @@ for more information.
97
97
98
98
To get a collection to use, just specify the name of the collection to
99
99
the [ getCollection(String
100
- collectionName)] ( http://api.mongodb.org/java/2.13 /com/mongodb/DB.html#getCollection%28java.lang.String%29 )
100
+ collectionName)] ( http://api.mongodb.org/java/2.14 /com/mongodb/DB.html#getCollection%28java.lang.String%29 )
101
101
method:
102
102
103
103
``` java
@@ -110,7 +110,7 @@ data, query for data, etc
110
110
## Setting Write Concern
111
111
112
112
As of version 2.10.0, the default write concern is
113
- [ WriteConcern.ACKNOWLEDGED] ( http://api.mongodb.org/java/2.13 /com/mongodb/WriteConcern.html#ACKNOWLEDGED ) ,
113
+ [ WriteConcern.ACKNOWLEDGED] ( http://api.mongodb.org/java/2.14 /com/mongodb/WriteConcern.html#ACKNOWLEDGED ) ,
114
114
but it can be easily changed:
115
115
116
116
``` java
@@ -120,7 +120,7 @@ mongoClient.setWriteConcern(WriteConcern.JOURNALED);
120
120
There are many options for write concern. Additionally, the default
121
121
write concern can be overridden on the database, collection, and
122
122
individual update operations. Please consult the [ API
123
- Documentation] ( http://api.mongodb.org/java/2.13 /index.html ) for
123
+ Documentation] ( http://api.mongodb.org/java/2.14 /index.html ) for
124
124
details.
125
125
126
126
## Inserting a Document
@@ -143,7 +143,7 @@ be represented as
143
143
144
144
Notice that the above has an "inner" document embedded within it. To do
145
145
this, we can use the
146
- [ BasicDBObject] ( http://api.mongodb.org/java/2.13 /com/mongodb/BasicDBObject.html )
146
+ [ BasicDBObject] ( http://api.mongodb.org/java/2.14 /com/mongodb/BasicDBObject.html )
147
147
class to create the document (including the inner document), and then
148
148
just simply insert it into the collection using the ` insert() ` method.
149
149
@@ -159,10 +159,10 @@ coll.insert(doc);
159
159
160
160
To show that the document we inserted in the previous step is there, we
161
161
can do a simple
162
- [ findOne()] ( http://api.mongodb.org/java/2.13 /com/mongodb/DBCollection.html#findOne%28java.lang.Object%29 )
162
+ [ findOne()] ( http://api.mongodb.org/java/2.14 /com/mongodb/DBCollection.html#findOne%28java.lang.Object%29 )
163
163
operation to get the first document in the collection. This method
164
- returns a single document (rather than the [ DBCursor] ( http://api.mongodb.org/java/2.13 /com/mongodb/DBCursor.html )
165
- that the [ find()] ( http://api.mongodb.org/java/2.13 /com/mongodb/DBCollection.html#find()' )
164
+ returns a single document (rather than the [ DBCursor] ( http://api.mongodb.org/java/2.14 /com/mongodb/DBCursor.html )
165
+ that the [ find()] ( http://api.mongodb.org/java/2.14 /com/mongodb/DBCollection.html#find()' )
166
166
operation returns), and it's useful for things where there only is one
167
167
document, or you are only interested in the first. You don't have to
168
168
deal with the cursor.
0 commit comments