Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Property Attribute [BsonRequired] has no effect

Received: by 10.224.219.144 with SMTP id hu16mr5016224qab.1.1353160898671;
        Sat, 17 Nov 2012 06:01:38 -0800 (PST)
X-BeenThere: mongodb-user@googlegroups.com
Received: by 10.49.61.67 with SMTP id n3ls1367074qer.3.gmail; Sat, 17 Nov 2012
 06:01:13 -0800 (PST)
Received: by 10.58.66.199 with SMTP id h7mr2386559vet.12.1353160873589;
        Sat, 17 Nov 2012 06:01:13 -0800 (PST)
Received: by 10.58.66.199 with SMTP id h7mr2386558vet.12.1353160873574;
        Sat, 17 Nov 2012 06:01:13 -0800 (PST)
Return-Path: <rob...@10gen.com>
Received: from mail-vc0-f169.google.com (mail-vc0-f169.google.com [209.85.220.169])
        by gmr-mx.google.com with ESMTPS id bn19si368210vdb.0.2012.11.17.06.01.13
        (version=TLSv1/SSLv3 cipher=OTHER);
        Sat, 17 Nov 2012 06:01:13 -0800 (PST)
Received-SPF: pass (google.com: domain of rob...@10gen.com designates 209.85.220.169 as permitted sender) client-ip=209.85.220.169;
Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of rob...@10gen.com designates 209.85.220.169 as permitted sender) smtp.mail=rob...@10gen.com
Received: by mail-vc0-f169.google.com with SMTP id fl17so3608202vcb.28
        for <mongodb-user@googlegroups.com>; Sat, 17 Nov 2012 06:01:13 -0800 (PST)
        d=google.com; s=20120113;
        h=mime-version:in-reply-to:references:date:message-id:subject:from:to
         :content-type:x-gm-message-state;
        bh=byR8S5uE2rrOD0801v1wMNrO53sAFATdHX/fFZrPdWI=;
        b=fc7Zoowf/Si7yyN5UPz2R/PEuyMgOqQ1dH4D+wxVNZuwvydJe85hZ1/bh6Z4+54Hz7
         WUBQfnOBGxzR0kylhapY+yuTdTQ9TuR9cQtzaMY8AKbLA5io27Dod1N0W/0V/0vENkiN
         JdIXVx3rzgVr5+3mNgABH8RM3ZuM5t0dBhLuDwQkb3E84dxZV+HMqmjNr+02IzU0NUKE
         eRvl6+xp4JMyEIHNbITvWxHrYEidqT91K8XAvPJGersgm1PprWbDf6hC7Du8m+mlRK39
         n5xOCQOjHRTb0E8Pk0ByAvl0JR/0ZnCWkdN8e89i50TtIFYtUmYytqDBrMEXF80ODbgt
         e6CQ==
MIME-Version: 1.0
Received: by 10.52.92.11 with SMTP id ci11mr7828274vdb.7.1353160873425; Sat,
 17 Nov 2012 06:01:13 -0800 (PST)
Received: by 10.58.135.6 with HTTP; Sat, 17 Nov 2012 06:01:13 -0800 (PST)
In-Reply-To: <eabdbfd6-1a24-4571-b3b9-8738af86778f@googlegroups.com>
References: <eabdbfd6-1a24-4571-b3b9-8738af86778f@googlegroups.com>
Date: Sat, 17 Nov 2012 09:01:13 -0500
Message-ID: <CAJCJWG3HRJeshy7wono0Z0BzCp2DCug_R89FvVcFVofk5EZ...@mail.gmail.com>
Subject: Re: [mongodb-user] Property Attribute [BsonRequired] has no effect
From: Robert Stam <rob...@10gen.com>
To: mongodb-user@googlegroups.com
Content-Type: multipart/alternative; boundary=20cf3071ce0a2f3bb704ceb151d2
X-Gm-Message-State: ALoCoQkH0L0vgK68lyUlofPuDFJWsNckqVWhum1YYFqNVxfk/gOImYI4SOlyaw2a8pts0IeXjrvy

--20cf3071ce0a2f3bb704ceb151d2
Content-Type: text/plain; charset=ISO-8859-1

[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 mongodb-user@googlegroups.com
> To unsubscribe from this group, send email to
> mongodb-user+unsubscribe@googlegroups.com
> See also the IRC channel -- freenode.net#mongodb
>

--20cf3071ce0a2f3bb704ceb151d2
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div>[BsonRequired] means something else: it means that documents read from=
 the database must have this field. It does not mean that the value can&#39=
;t be null, just that the field must present.</div><div><br><div class=3D"g=
mail_quote">
On Sat, Nov 17, 2012 at 1:19 AM, U.Heinemann <span dir=3D"ltr">&lt;<a href=
=3D"mailto:uh3...@gmail.com" target=3D"_blank">uh3...@gmail.com</a>&gt;</sp=
an> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;=
border-left:1px #ccc solid;padding-left:1ex">
I tried both ways, decorating the class property and alternatively using th=
e code. In my understanding, when someone tries to insert or update=A0 and =
the required field value is null, an error should be raised. But this is no=
t the case, the null value is inserted.<span class=3D"HOEnZb"><font color=
=3D"#888888"><br>


<p></p>

-- <br>
You received this message because you are subscribed to the Google<br>
Groups &quot;mongodb-user&quot; group.<br>
To post to this group, send email to <a href=3D"mailto:mongodb-user@googleg=
roups.com" target=3D"_blank">mongodb-user@googlegroups.com</a><br>
To unsubscribe from this group, send email to<br>
<a href=3D"mailto:mongodb-user%2Bunsubscribe@googlegroups.com" target=3D"_b=
lank">mongodb-user+unsubscribe@googlegroups.com</a><br>
See also the IRC channel -- <a href=3D"http://freenode.net#mongodb" target=
=3D"_blank">freenode.net#mongodb</a><br>
</font></span></blockquote></div><br></div>

--20cf3071ce0a2f3bb704ceb151d2--