You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+20-20Lines changed: 20 additions & 20 deletions
Original file line number
Diff line number
Diff line change
@@ -1,23 +1,23 @@
1
-
# MongoDB Persistor
1
+
# Vert.x 2.x is **deprecated** - use instead http://vertx.io/docs/vertx-mongo-client/java/
2
+
3
+
## MongoDB Persistor
2
4
3
5
This module allows data to be saved, retrieved, searched for, and deleted in a MongoDB instance. MongoDB is a great match
4
6
for persisting vert.x data since it natively handles JSON (BSON) documents.
5
7
6
-
# WARNING - Vertx-3 now has new Mongo 'modules', this mod should only be used for vertx 2.x
7
-
8
-
####To use this module you must have a MongoDB instance running on your network.
8
+
##### To use this module you must have a MongoDB instance running on your network.
9
9
10
10
This is a multi-threaded worker module.
11
11
12
-
## Dependencies
12
+
###Dependencies
13
13
14
14
This module requires a MongoDB server to be available on the network.
15
15
16
-
## Name
16
+
###Name
17
17
18
18
The module name is `mongo-persistor`.
19
19
20
-
## Configuration
20
+
###Configuration
21
21
22
22
The mongo-persistor module takes the following configuration:
23
23
@@ -59,7 +59,7 @@ Let's take a look at each field in turn:
59
59
*`read_preference` is the read preferences, see http://docs.mongodb.org/manual/core/read-preference/. Default is "primary".
60
60
*`use_mongo_types` enable the use of mongo types such as Date, byte array, array list. Note that if enabled this will incur a performance overhead to all queries. Default is `false`.
61
61
62
-
### Replsets or sharding
62
+
####Replsets or sharding
63
63
64
64
If you want to use sharding or a replica set then you need to provide a list of seed addresses, these take
65
65
priority over the host/port combination. For example:
@@ -76,11 +76,11 @@ priority over the host/port combination. For example:
76
76
77
77
The seeds variable takes a list of objects which specify the host and port of each member of your seed list.
78
78
79
-
## Operations
79
+
###Operations
80
80
81
81
The module supports the following operations
82
82
83
-
### Save
83
+
####Save
84
84
85
85
Saves a document in the database.
86
86
@@ -136,7 +136,7 @@ Where
136
136
*`message` is an error message.
137
137
138
138
139
-
### Update
139
+
####Update
140
140
141
141
Updates a document in the database.
142
142
Uses the Mongodb update function: http://www.mongodb.org/display/DOCS/Updating
@@ -182,7 +182,7 @@ An example would be:
182
182
183
183
184
184
185
-
### Find
185
+
####Find
186
186
187
187
Finds matching documents in the database.
188
188
@@ -282,7 +282,7 @@ Equivalence in mongoDB:
282
282
283
283
db.order.find().skip(10).limit(10)
284
284
285
-
#### Batching
285
+
#####Batching
286
286
287
287
If a find returns many documents we do not want to load them all up into memory at once and send them in a single JSON message since this could result in the server running out of RAM.
288
288
@@ -319,7 +319,7 @@ For instance, in JavaScript you might do something like:
319
319
If there is more data to be requested and you do not reply to get the next batch within a timeout (see `timeout parameter`), then the underlying MongoDB cursor will be closed, and any further attempts to request more will fail.
320
320
321
321
322
-
### Find One
322
+
####Find One
323
323
324
324
Finds a single matching document in the database.
325
325
@@ -368,7 +368,7 @@ If an error occurs in finding the documents a reply is returned:
368
368
Where
369
369
*`message` is an error message.
370
370
371
-
### Find and modify
371
+
####Find and modify
372
372
373
373
The findAndModify command atomically modifies and returns a single document. By default, the returned document does not include the modifications made on the update. To return the document with the modifications made on the update, use the `new` option. See http://docs.mongodb.org/manual/reference/command/findAndModify/ for details:
374
374
@@ -410,7 +410,7 @@ An example would be:
410
410
411
411
This would find a document in the `counters` collection with an `_id` of "people" and increment its `seq` field and reply successfully with the new document, as `new` was set to true.
412
412
413
-
### Count
413
+
####Count
414
414
415
415
Counts the number of documents within a collection:
416
416
@@ -558,7 +558,7 @@ If an error occurs in finding the documents a reply is returned:
558
558
Where
559
559
*`message` is an error message.
560
560
561
-
### Get Collections List
561
+
####Get Collections List
562
562
563
563
Returns the list of collection names in the db:
564
564
@@ -657,7 +657,7 @@ If an error occurs in finding the documents a reply is returned:
657
657
Where
658
658
*`message` is an error message.
659
659
660
-
### Drop Collection
660
+
####Drop Collection
661
661
662
662
Drops a collection from the db:
663
663
@@ -699,7 +699,7 @@ Where
699
699
*`message` is an error message.
700
700
701
701
702
-
### Command
702
+
####Command
703
703
704
704
Runs an arbitrary MongoDB command.
705
705
@@ -723,7 +723,7 @@ You would expect a result something like:
723
723
"status":"ok"
724
724
}
725
725
726
-
### writeConcern
726
+
####writeConcern
727
727
728
728
The operations save, update and delete have an optional field called "writeConcern". Setting this property in your request
0 commit comments