Re: [mongodb-user] Property Attribute [BsonRequired] has no effect

24 views
Skip to first unread message

Robert Stam

unread,
Nov 17, 2012, 9:01:13 AM11/17/12
to mongod...@googlegroups.com
[BsonRequired] means something else: it means that documents read from the database must have this field. It does not mean that the value can't be null, just that the field must present.

On Sat, Nov 17, 2012 at 1:19 AM, U.Heinemann <uh3...@gmail.com> wrote:
I tried both ways, decorating the class property and alternatively using the code. In my understanding, when someone tries to insert or update  and the required field value is null, an error should be raised. But this is not the case, the null value is inserted.

--
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To post to this group, send email to mongod...@googlegroups.com
To unsubscribe from this group, send email to
mongodb-user...@googlegroups.com
See also the IRC channel -- freenode.net#mongodb

Reply all
Reply to author
Forward
0 new messages