在Ember JS DS.store模型中查询

时间:2017-03-30 14:35:59

标签: ember.js ember-data

我在两个查询下面尝试过:

    this.store.query('estimate', { 'vendorUids' : supplierData.getEach('vendorUid') } ).then((estimatesData)=>{

});

this.store.query('estimate', { filter : { 'vendorUids' : supplierData.getEach('vendorUid') } }).then((estimatesData)=>{

});

但它正在创建如下查询:

https://localhost:8080/v1/estimates?vendorUids[]=344&vendorUids[]=5&vendorUids[]=1&vendorUids[]=2&vendorUids[]=3&vendorUids[]=4

https://localhost:8080/v1/estimates?filter[vendorUid][]=344&filter[vendorUid][]=344&filter[vendorUid][]=344

我希望像查询一样生成查询:

https://localhost:8080/v1/estimates?vendorUids=[1,2,3,4,5]

先谢谢。

1 个答案:

答案 0 :(得分:0)

以下代码对我有用:

supplierData.getEach('vendorUid').toString();