lostintranslation
lostintranslation

Reputation: 24583

Mongoose without schema

What is currently the 'right' way to insert objects/documents into mongoose without defining a schema?

I have read a few things like this: How do you use Mongoose without defining a schema?

Any ideas

Upvotes: 3

Views: 10210

Answers (1)

anthonylawson
anthonylawson

Reputation: 781

Mongoose says that you can use a Mixed schema to define a schema-less type. The trade off is that you have to tell mongoose if you modified Mixed Schema value before you call save. Other than that, you should be able to define anything you want in the "schema".

Docs - http://mongoosejs.com/docs/schematypes.html#mixed

Upvotes: 4

Related Questions