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 Compare against current server date
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Sam Martin  
View profile  
 More options Mar 19 2012, 12:25 pm
From: Sam Martin <sambomar...@gmail.com>
Date: Mon, 19 Mar 2012 09:25:07 -0700 (PDT)
Local: Mon, Mar 19 2012 12:25 pm
Subject: Re: [mongodb-csharp] Compare against current server date

Sorry, forgot the find bit (from ipad not easy)

var query = Query.LTE("BDay", DateTime.Now);
foreach (BsonDocument guest in guests.Find(query)) {
    // do something with guest}

On Monday, March 19, 2012 4:20:03 PM UTC, Sam Martin wrote:

> Query.Lte("dt", DateTime.Now)

> You can still execute the JavaScript equiv using BsonDocument too.

> Sam Martin

> On 19 Mar 2012, at 16:06, TM <protel...@googlemail.com> wrote:

> > Hi,

> > is is possible to compare against the current server date and time in
> > an query? In SQL Server I would use getdate() or now() in mysql.

> > As I use the mongo shell very rarly I think I have to use something
> > like this :

> > db.Guest.find({Bday:{$lt:new Date()}})

> > How would I write the query in C#?

> > Thanks!


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.