Filippo oretti
Filippo oretti

Reputation: 49817

Mongo DB collection fields schema best practice

I would like to know how does i have to set up my collections schemas?

I mean first i need ,for example, a user object (username,email,password), then i need a field to make users confirm registration so need i to insert all fields when inserting users (username,email,password,confirm=0)

or

better to create confirm field only when user goes to confirm his registration account?

Upvotes: 0

Views: 312

Answers (1)

Karoly Horvath
Karoly Horvath

Reputation: 96258

The missing confirm field tells you that it's 0, so both seem to be fine, it's just a matter of taste.

Upvotes: 1

Related Questions