Closed jannyHou closed 4 years ago
See parent story https://github.com/strongloop/loopback-connector-cloudant/issues/214
Model Order has userId as its partition key.
Order
userId
[x] Support providing the partitionKey in query, like Order.find({where: {somefield: 'somevalue', userId: 'auser',}})
partitionKey
Order.find({where: {somefield: 'somevalue', userId: 'auser',}})
Cloudant.prototype.find()
db.partitionedFind('auser', queryWithPartitionKeyExcluded)
options
closing as PR merged
See parent story https://github.com/strongloop/loopback-connector-cloudant/issues/214
Acceptance Criteria
Model
Order
hasuserId
as its partition key.[x] Support providing the
partitionKey
in query, likeOrder.find({where: {somefield: 'somevalue', userId: 'auser',}})
Cloudant.prototype.find()
, ifpartitionKey
is detected in the where clause, then invokedb.partitionedFind('auser', queryWithPartitionKeyExcluded)
partitionKey
fromoptions
should override the one from where clause.