firestore数组包含仅适用于字符串,不适用于对象

时间:2018-08-31 04:08:27

标签: javascript firebase google-cloud-firestore

this.afs
      .collection('userroutes' + cityid, ref =>
        ref.where(
          'requestList',
          'array-contains',
          'str'
        )
      )
      .valueChanges()
      .subscribe(data => {
        //I get the data
        //this works
      });`

不起作用

this.afs
  .collection('userroutes' + cityid, ref =>
    ref.where(
      'requestList.id',  <-- in case of object search what it will
      'array-contains',
      'ED8r2DWAcyM0sKJiAJxwwAVDm2q2'
    )
  )
  .valueChanges()
  .subscribe(data => {
    //this do not give any data....
    //though this id is present id firebase db
  });

不起作用

this.afs
  .collection('userroutes' + cityid, ref =>
    ref.where(
      'requestList',  <-- in case of object search what it will
      'array-contains',
      'ED8r2DWAcyM0sKJiAJxwwAVDm2q2'
    )
  )
  .valueChanges()
  .subscribe(data => {
    //this do not give any data....
    //though this id is present id firebase db
  });

我正在尝试使用Firebase 5.3.0中包含数组的新功能;我看到它仅适用于字符串,不适用于对象;

这在使用字符串的情况下可以正常工作。

0 个答案:

没有答案