Manuel
Manuel

Reputation: 11469

How can I convert a json string to bson in the MongoDB console?

Every example I see uses some kind of driver (how to do it in C#/java/etc.) There's the tojson function but there isn't a tobson one.

How can I convert a json string to bson object in the MongoDB console?

Upvotes: 0

Views: 2809

Answers (1)

Asya Kamsky
Asya Kamsky

Reputation: 42342

You actually want to turn it into JSON so that you can insert it, not BSON.

This question has the answer as to how: Safely turning a JSON string into an object

Upvotes: 1

Related Questions