-
Notifications
You must be signed in to change notification settings - Fork 0
FAQ
-
Root Clause: You are using multiple version
couchbase
SDKSolution: Unified the
couchbase
SDK version.-
Use
yarn list couchbase
to list all the lib who depends oncouchbase
-
If you want to use
couchbase==2.6.4
but theloopback-connector-couchbase5
is using2.6.3
, Update package.json as following:"resolutions": { "loopback-connector-couchbase5/**/couchbase": "^2.6.4" }
-
-
There are serval possibilities:
-
You have a ORDER BY statement in your query
An N1QL example:
select * from sample where type = 'Hotel' ORDER BY city DESC
-
If you only have the
type
index and you have 1,000 + hotel matched records, the Query Service will fetch all matched records and sort in memory. -
If you have
type
andcity
index, but without theDESC
in create statement, the Query Service will still use a memory sort. Look at here for detail. -
If you have
type
andcity DESC
index, but the Query Service still using wrong index (may be thetype
index), try to use query option to force Query Service to use specific index, an example as follows:
const hotels = await Hotel.query({ where: {}}, { index: 'city_type_index'});
-
-
The index status is not ready.
-
Check the index status at Admin Web UI or use N1QL as follows
SELECT * from system:indexes
-
If the index is not at
ready
, Run BUILD INDEX to kick off the buliding progress.
-
You are using primary index to fulfill the query.
- Update the mixins options to disable primary as follows
{ "name": "Example", "base": "PersistedModel", "mixins": { "N1ql": { "primary": false, # Here "drop": false, "deferred": true } }, "indexes": { "status_type": { "keys": { "type": 1, "_type": 1, "status": 1, "createdAt": 1 } }, }, "properties": {}, "validations": [], "relations": {}, "acls": [], "methods": {} }
- Drop primary index on test environment (DO NOT it at prod)
- find out which query (API) are using primary index,
- create an GSI or VIEW index to service the query.
-