@@ -386,13 +386,43 @@ Deletes the collection from the database.
386386
387387### Manipulating documents
388388
389+ #### collection.import(data, [ opts,] callback)
390+
391+ Bulk imports the given * data* into the collection.
392+
393+ The * data* can be an array of documents:
394+
395+ ``` js
396+ [
397+ {key1: value1, key2: value2}, // document 1
398+ {key1: value1, key2: value2}, // document 2
399+ ...
400+ ]
401+ ```
402+
403+ Or it can be an array of value arrays following an array of keys.
404+
405+ ``` js
406+ [
407+ [' key1' , ' key2' ], // key names
408+ [value1, value2], // document 1
409+ [value1, value2], // document 2
410+ ...
411+ ]
412+ ```
413+
414+ If * opts* is set, it must be an object with any of the following properties:
415+
416+ * * waitForSync* : Wait until the documents have been synced to disk. Default: * false* .
417+ * * details* : Whether the response should contain additional details about documents that could not be imported. Default: * false* .
418+
389419#### collection.replace(documentHandle, data, [ opts,] callback)
390420
391421Replaces the content of the document with the given * documentHandle* with the given * data* .
392422
393423If * opts* is set, it must be an object with any of the following properties:
394424
395- * * waitForSync* : Wait until document has been synced to disk. Default: ` false ` .
425+ * * waitForSync* : Wait until the document has been synced to disk. Default: ` false ` .
396426* * rev* : Only replace the document if it matches this revision. Optional.
397427* * policy* : Determines the behaviour when the revision is not matched:
398428 * if * policy* is set to ` "last" ` , the document will be replaced regardless of the revision.
0 commit comments