On Feb 10, 4:36 pm, Robert Stam <
rob...@10gen.com> wrote:
> I don't think it is valid. I just don't know why you don't get an error
> message. The results it returns are incorrect.
>
> Here's a simplified example showing that it returns the wrong results. The
> query is intended to return all documents that have a t value starting with
> "x" or "y", but it obviously returns documents that don't match:
>
> > db.test.remove()
> > db.test.insert({t:"a"})
> > db.test.insert({t:"b"})
> > db.test.find({t:{$regex:[/^x/,/^y/]}})
>
> { "_id" : ObjectId("4f3530db0105ec90fee42bbd"), "t" : "a" }
> { "_id" : ObjectId("4f3530df0105ec90fee42bbe"), "t" : "b" }
>
>
>
> Have you seen an example in the documentation that shows a $regex element
> whose value is an array of regexes? If so, where?
>