and I write n1ql query. query is here:
select oms.*
from MERCH_RULE oms
where oms.identifier.recordType = ‘ATPCO_RECORD_X_1’
and oms.identifier.mode = ‘ON’
and oms.identifier.kind IN [‘MANUAL’, ‘AUTO’]
and (oms.geographicIdentifier.geographicInfos.cities.value IN [‘AR’, ‘IST’] OR
oms.geographicIdentifier.geographicInfos.countries.value IN [‘AR’, ‘IST’] OR
oms.geographicIdentifier.geographicInfos.airports.value IN [‘AR’, ‘IST’] OR
oms.geographicIdentifier.geographicInfos.zones.value IN [‘AR’, ‘IST’] OR
oms.geographicIdentifier.geographicInfos.markets.value IN [‘AR’, ‘IST’])
but When I compile this query, I get error. where is my fault consider my model and query.
Parsing of the input failed {“completed”:true,“coreId”:“0x65e9c79c00000002”,“errors”:[{“code”:3000,“message”:“syntax error - at value”,“retry”:false}],“httpStatus”:400,“idempotent”:false,“lastDispatchedFrom”:“10.27.34.45:62020”,“lastDispatchedTo”:“192.168.44.97:8093”,“requestId”:576169,“requestType”:“QueryRequest”,“retried”:0,“service”:{“operationId”:“33055180-e478-4d50-aa81-cd22a92eb511”,“statement”:"select oms.*\r\nfrom MERCH_RULE oms\r\nwhere oms.identifier.recordType = ‘ATPCO_RECORD_X_1’\r\n and oms.identifier.mode = ‘ON’\r\n and oms.identifier.kind IN [‘MANUAL’, ‘AUTO’]\r\n and ( oms.geographicIdentifier.geographicInfos.cities.value IN [‘AR’, ‘IST’]\r\n OR oms.geographicIdentifier.geographicInfos.countries.value IN [‘AR’, ‘IST’]\r\n OR oms.geographicIdentifier.geographicInfos.airports.value IN [‘AR’, ‘IST’]\r\n OR oms.geographicIdentifier.geographicInfos.zones.value IN [‘AR’, ‘IST’]\r\n OR oms.geographicIdentifier.geographicInfos.markets.value IN [‘AR’, 'IST …
It seems to indicate that there is a reserved word “value” at line 6, column 54.
If that was the only issue, then escaping all the “value” attribute names with back-ticks would solve it. (i.e. oms.geographicIdentifier.geographicInfos.cities.`value` )
But looking at your model, it appears that countries, airports, zones and markets are all arrays. So you would need to use SATISFIES. Collection Operators | Couchbase Docs
SELECT oms.*
FROM MERCH_RULE oms
WHERE oms.`identifier`.recordType = "ATPCO_RECORD_X_1"
AND oms.`identifier`.mode = "ON"
AND oms.`identifier`.kind IN ["MANUAL", "AUTO"]
AND ANY v IN ARRAY_CONCAT(oms.geographicIdentifier.geographicInfos.cities,
oms.geographicIdentifier.geographicInfos.countries,
oms.geographicIdentifier.geographicInfos.airports,
oms.geographicIdentifier.geographicInfos.zones,
oms.geographicIdentifier.geographicInfos.markets)
SATIESFIES v.`value` IN ["AR", "IST"] END;