A
A
Abc Edc2015-02-01 16:21:53
MongoDB
Abc Edc, 2015-02-01 16:21:53

How to make a field where only two mongoDb selections are stored?

So that the field has something like 1 or 0 , in my case Public or private ?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
index0h, 2015-02-01
@gleber1

This is entirely up to the developer. Mongo does not impose special requirements on documents (well, except for valid json). Therefore, at the insert / update stage, you must ensure that either 0 or 1 is written to your field.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question