Skip to content

Conversation

@TylerBrock
Copy link
Contributor

This change makes it so that all insert write operations automatically supply a client generated _id if one is not already provided.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can simplify a little by reversing the check:

if (!current.hasField("_id")) {
BSONObjBuilder bob;
// add id
// add existing elements
current = bob.obj();
}

inserts.enqueue( new ... (current));

@acmorrow
Copy link
Contributor

Looks great to me. Love how simple this ended up.

@TylerBrock
Copy link
Contributor Author

Yeah, thank you for the feedback.

@TylerBrock TylerBrock merged commit 4f5bc65 into mongodb:legacy Jun 11, 2014
@TylerBrock TylerBrock deleted the CXX-180 branch June 11, 2014 20:40
@TylerBrock TylerBrock restored the CXX-180 branch June 11, 2014 20:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants