Datastore Queries to retrive multiple values in GC

2019-08-04 06:28发布

How to retrieve multiple values in single field in datastore nodejs. code:

const query = datastore.createQuery('Task')
.filter('user_id', '=', [1,2,3])

.order('priority', {
descending: true
});

this is not working. I need query something like this

select userName from Table where user_id in (1, 2, 3);

1条回答
\"骚年 ilove
2楼-- · 2019-08-04 07:16

You can query to retrieve multiple values like the following:

If you have array of multiple datastore Id's like following:

[1,2,3,4]

You can query with gstore-node Package

var userData = await UserModel.get([1,2,3,4]);

Hope this will help you.

Thanks

查看更多
登录 后发表回答