Aurobindo
Aurobindo

Reputation: 11

Create MongoDB document without values

I have a basic question about creating a physical schema of a collection in MongoDB.

Can I create a MongoDB document without values. At this point I just know the keys and some data types. But I do not have the values. Is it possible to create a schema, where O just have place holders for values?

But putting such dummy values becomes complex when I have hundreds of fields, particularly nested ones such as document within a document or arrays.

I am trying to find a SQL world equivalent of "create table" where we can create physical schema, without putting the values

Any advice?

Thanks Aurobindo

Upvotes: -1

Views: 1400

Answers (1)

Neodan
Neodan

Reputation: 5252

If you want, you can insert a document with any content (you can insert only part of elements or even empty document). MongoDB is a document-oriented database, where each document can be absolutelly different.

Forget everything what you know about RDBMS, because this knowledge is absolutely useless in MongoDB world.

Upvotes: 0

Related Questions