Comments (6)
@biancajiang I am trying to reproduce your issue, Can you fork https://github.com/strongloop/loopback-sandbox and replace with your code? Include some details like which loopback api you called, or is it a native query directly talk to cloudant datasource. Thanks.
from loopback-connector-cloudant.
@jannyHou I'm not sure how to recreate it in a test env. w/o sharing the exact DB yet (proprietary data). The server and DB have been in use and working for months. Please let me know if you have any idea how to approach this.
Our models include objects like "Scan", "Package" and "LicenseFile". Scan has many Packages and many LicenseFiles. Package has many LicenseFiles.
Right now APIs involve packages are returning the 400 Error above like: /api/packages/bd3728cc668db9d363f0b0d98c448c96
Other model APIs w/o packages seem fine, like:
/api/scans/19569d5fa0f68f458772a5f2f1961b91
I can directly access package document with id from cloudant DB. But any query uses index would give this error.
An example of a Package document:
{
"_id": "bd3728cc668db9d363f0b0d98c448c96",
"_rev": "1-91ac6ab5ddb4b618f9ed0e7c15f8eac8",
"name": "oclazyload",
"version": "1.0.9",
"path": "bower_components/oclazyload",
"scanId": "148702417a38a0fb8aa6c0c9b48d17cc",
"license_types": [
"MIT"
],
"parentId": "1c77c1bfa27a4e0b44a24728fc40fa01",
"loopback__model__name": "package"
}
An example of a Scan document in the DB:
{
"_id": "19569d5fa0f68f458772a5f2f1961b91",
"_rev": "2-f8a73ba8102c5e03ee279aa3440b7449",
"date": "2016-11-21T16:09:16.037Z",
"project": "lucene-5.5.0",
"by": "[email protected]",
"scan-dir": "/Users/bj/playground/test_data/lucene-5.5.0",
"scan_time_ms": "253342 ms",
"directories_scanned": 1658,
"files_scanned": 25175,
"packages_found": 1,
"output_file": "lucene-5.5.0_scanresults_2016-11-21T16-09-16-037Z.json",
"cli_version": "0.5.19",
"status": {
"upload": "Scan Upload Completed successfully."
},
"loopback__model__name": "scan"
}
from loopback-connector-cloudant.
I created a simple model Test
and try get instance from cloudant server, it returns me the result successfully.
the query it runs:
{"selector":{"loopback__model__name":"Test","_id":"00476caeacb2ab5c33a0fc35c2208e5c"},"use_index":["lb-index-ddoc-Test","lb-index-Test"],"limit":1,"sort":[{"id:string":"asc"}]} +0ms
I didn't see problem here with the query itself. It's exactly the same query you use for your package model.
While I do reproduce the error with replicate db you provide me.
I understand that this blocks you badly but I am afraid we could not fix it on our end, because it breaks on that db and loopback-connector-cloudant is only an interface talking to db. Maybe try contact cloudant team who can read and understand the query error.
Good luck!
from loopback-connector-cloudant.
I am closing this issue since cloudant team would be proper to explain the error message and provide a solution. Thanks for understanding.
from loopback-connector-cloudant.
This was an issue with Cloudant DB and was resolved. Thanks!
from loopback-connector-cloudant.
@biancajiang Glad to hear it's solved :) No problem.
from loopback-connector-cloudant.
Related Issues (20)
- Out dated / error in dependancies HOT 2
- Count returns a max of 25 HOT 5
- Query "like and case insensitive" with issues HOT 7
- Add support Geospatial queries HOT 5
- Fix the filter for hasManyThrough relation HOT 2
- Fix CI - 2 test cases failed HOT 3
- Run shared tests from both v3 and v4 of juggler
- FindById doesn't use Cloudant Read by Id method HOT 8
- [Spike] Add Support for Partitioned Databases HOT 18
- Update driver to nodejs/cloudant HOT 5
- Support creating partitioned index HOT 1
- Optimize query by reading partition key from payload HOT 1
- Compose the _id for a document in a partition database HOT 3
- [Epic] Add Support for Partitioned Database HOT 2
- findAll: Read partitionKey from `options` HOT 3
- Optimize findById for partitioned database HOT 4
- [Epic] Add Support for Partitioned Database (Post MVP) HOT 5
- [Blog] Blog post about the support for partitioned database HOT 2
- Invalid key partitioned using with Cloudant docker locally HOT 6
- Move to @ibm-cloud/cloudant HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from loopback-connector-cloudant.