deltanovember
deltanovember

Reputation: 44041

How can I directly insert JSON using Mongoose/MongoDB?

It seems a bit convoluted to manually define a schema when I'm dealing with JSON all the time. Is there a way to convert JSON into BSON thereby relieving the developer of the need to manually define schemas each time?

Upvotes: 1

Views: 2343

Answers (2)

deltanovember
deltanovember

Reputation: 44041

There is a tool mongoimport to do this

http://www.mongodb.org/display/DOCS/Import+Export+Tools

Upvotes: -1

mstearn
mstearn

Reputation: 4276

Have you looked at node-mongodb-native[1]? It sounds like it might be a better fit for your needs since it doesn't require a predefined schema.

[1] https://github.com/christkv/node-mongodb-native

Upvotes: 2

Related Questions