Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not found minus value. #17

Closed
knoro opened this issue May 13, 2016 · 3 comments
Closed

Could not found minus value. #17

knoro opened this issue May 13, 2016 · 3 comments
Assignees
Labels

Comments

@knoro
Copy link

knoro commented May 13, 2016

Hi.

I tried found at cloudant data, but could not found minus value data.

success: lat = 90
failed: lat = -90

How to find the minus value data ?

source: --databasename--.js

.
--databasename--.find({"where":{"and":[{"lat":-90}]}},function(err, result) {
            if (err) {
                console.log("--- error ---";
            } else {
                console.log("---  lng: ",  result.lng);
            }
}
.

model.properties: --databasename--.json

.
  "properties": {
    "_id": {
      "type": "string",
      "id": 1
    },
    "_rev": {
      "type": "string"
    },
    "timestamp": {
      "type": "date"
    },
    "lat": {
      "type": "number"
    }
}
.

cloudant data:

{
  "_id": "{any_id}",
  "_rev": "{any_rev}",
  "timestamp": "2016-05-12T06:00:00Z",
  "lat": -90
  "lng": 130
}
,
{
  "_id": "{any_id}",
  "_rev": "{any_rev}",
  "timestamp": "2016-05-12T06:00:00Z",
  "lat": 90
  "lng": 135
}

I tried in cloudant query box , but also could not found.

query:

{
  "selector": {
    "loopback__model__name": "--databacename--",
    "lat": -90
  },
  "fields": ["_id", "_rev",  "lat", "lng" ]
}
@knoro knoro changed the title Cannot found minus value. Could not found minus value. May 13, 2016
@tonyffrench tonyffrench self-assigned this May 26, 2016
@b-admike b-admike added this to the Sprint 37 - Apex milestone May 29, 2017
@jannyHou jannyHou assigned jannyHou and unassigned tonyffrench May 30, 2017
@dhmlau
Copy link
Member

dhmlau commented Jun 2, 2017

@virkt25 could you please take a look? thanks.

@jannyHou
Copy link
Contributor

jannyHou commented Jun 5, 2017

Worked with @virkt25 on it, suspect it's a bug on Cloudant side, the Cloudant query only takes in JSON format query, then Cloudant query parser converts it to Lucene syntax query, while seems the parser doesn't handle minus value properly(e.g. escape dash)

I emailed Cloudant support team, waiting for reply.

@jannyHou
Copy link
Contributor

ah, the latest release of Cloudant Local docker@3 fixes the problem.

screen shot 2017-06-12 at 2 44 24 pm

Please make sure you update to the latest Cloudant version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants