special: _id
json: type, client_id
json: last_payment
json: type
json: date
json: date, time
json: type, client_id, date
json: datetime
json: client_id
json: type, customer_name
json: customer_name

{ selector: { "type": { "$eq": "client" } } }

- Matt


-----Original Message-----
From: Garren Smith [mailto:[email protected]] 
Sent: Thursday, August 24, 2017 11:00 AM
To: [email protected]
Subject: Re: Mango query with $eq operator returns no results, but $regex does

Can you give me a full list of all your indexes and the query you are running.

On Thu, 24 Aug 2017 at 5:45 PM Matt Cosentino <[email protected]> wrote:

> Ugraded to 2.1, still get no results, and now get no results for the 
> $regex query as well. If I do a query of $gt null, the results I'm 
> looking for are there.
>
> - Matt
>
>
> -----Original Message-----
> From: Matt Cosentino [mailto:[email protected]]
> Sent: Thursday, August 24, 2017 9:41 AM
> To: [email protected]
> Subject: RE: Mango query with $eq operator returns no results, but 
> $regex does
>
> I have an index created for "type".
>
> {
>  "type": "json",
>  "def": {
>   "fields": [
>    {
>     "type": "asc"
>    }
>   ]
>  }
> }
>
> I'll try upgrading my test server to 2.1 and see if that helps, thanks.
>
> - Matt
>
>
> -----Original Message-----
> From: Garren Smith [mailto:[email protected]]
> Sent: Thursday, August 24, 2017 4:38 AM
> To: user <[email protected]>
> Subject: Re: Mango query with $eq operator returns no results, but 
> $regex does
>
> Hi Matt,
>
> What are your indexes? Also could you try these queries on CouchDB 2.1.
> The index selector was improved significantly in 2.1 to avoid these 
> types of issues.
>
> Cheers
> Garren
>
> On Wed, Aug 23, 2017 at 9:49 PM, Matt Cosentino 
> <[email protected]>
> wrote:
>
> > This is very strange. I have a very simple query:
> >
> > { selector: { "type": { "$eq": "client" } } }
> >
> > This returns no results, but there are documents with a type value 
> > of client, and the index exists.
> >
> > I try other values in the query and they all work.
> >
> > I try this query instead:
> >
> > { selector: { "type": { "$regex": "client" } } }
> >
> > This gives me the results I expect. Why?
> >
> > Here's another strange thing. I have another version of my database 
> > on another server. I run the original query there and it works. Both 
> > servers are running version 2.0 of CouchDB. Does anyone have any 
> > idea what could be wrong?
> >
> >
> > - Matt
> >
> >
>

Reply via email to