[DOCS-2813] Shell Bulk API additions Created: 27/Feb/14  Updated: 01/May/14  Resolved: 01/May/14

Status: Closed
Project: Documentation
Component/s: manual
Affects Version/s: None
Fix Version/s: v1.3.4, mongodb-2.6

Type: Improvement Priority: Major - P3
Reporter: Andreas Nilsson Assignee: Kay Kim (Inactive)
Resolution: Done Votes: 0
Labels: 26qa, sprint-rollover
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-12995 Updating docs with bulk API does not ... Closed
Participants:
Days since reply: 9 years, 41 weeks, 6 days ago

 Description   

1. There is no discussion of return values from the bulk operations, what to expect and how to interpret them.
After a bulk operation you might want to verify nUpserted, nMatched, nRemoved, getUpsertedIds(), getWriteErrorCount() etc.

2. I would also like some word of warning somewhere in the docs. This is a low confidence API in the sense that there is no real error recovery. If you get one or several write errors during the bulk op there is no way of re-executing the batch and it is fairly difficult to analyze which operations failed and for which reasons. Stated crudely, if you care a lot about data loss you should not use this API.

3. For unordered bulks we should point out that certain operation combinations are illegal, or non-sensical. For instance a

insert({a:1})
remove({a:1})

will either be a no-op (add and remove) or potentially fail on the remove.



 Comments   
Comment by Githook User [ 01/May/14 ]

Author:

{u'username': u'kay-kim', u'name': u'kay', u'email': u'kay.kim@10gen.com'}

Message: DOCS-2813 add bulk apis
Branch: master
https://github.com/mongodb/docs/commit/3af870074237fc409c1624800dd13c67fe1376c0

Comment by Andreas Nilsson [ 07/Mar/14 ]

Summary as a help for the docs, not sure that we want to document all of but here are all the publicly available parts of bulk_api.js

Functions on a bulk operation object

execute
find
insert
getOperations
tojson
toString

functions on a BulkWriteResults object

getUpsertedIds
getUpsertedIdAt
getRawResponse
hasWriteErrors
getWriteErrorCount
getWriteErrorAt
getWriteErrors
getWriteConcernError
tojson
toString
shellPrint
isOK
toSingleResult

properties of a BulkWriteResult and a SingleWriteResult object

ok
nInserted
nModified
nMatched
nUpserted
nRemoved

functions on a SingleWriteResult object generated from toSingleResult()

getUpsertedId
getRawResponse
hasWriteErrors
getWriteError
getWriteConcernError
tojson
toString
isOk

ck can you elaborate on the intended usage of SIngleWriteResult. Does is add any value outside what BulkWriteResult already provides?

Comment by Andreas Nilsson [ 03/Mar/14 ]

See SERVER-12995 for a good rational why the return value from write commands and the bulk API should be well documented.

Generated at Thu Feb 08 07:44:20 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.