Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/427.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript Angular Firestore |如何获取不包含的数组_Javascript_Firebase_Google Cloud Firestore_Angularfire2 - Fatal编程技术网

Javascript Angular Firestore |如何获取不包含的数组

Javascript Angular Firestore |如何获取不包含的数组,javascript,firebase,google-cloud-firestore,angularfire2,Javascript,Firebase,Google Cloud Firestore,Angularfire2,我在我的应用程序中使用Angular Firestore,我在编写一个查询时遇到了一个问题,该查询将返回我需要的所有对象 在下面的示例中,我在eat_by数组中获取了所有获得该用户id的水果 this.asf.collection('fruits', ref => ref.where('eat_by', 'array-contains', userId)).valueChanges(); 它工作得很好 但我的问题是做了相反的事情;我正在尝试获取没有用户ID的水果,按数组吃。 就像mong

我在我的应用程序中使用Angular Firestore,我在编写一个查询时遇到了一个问题,该查询将返回我需要的所有对象

在下面的示例中,我在eat_by数组中获取了所有获得该用户id的水果

this.asf.collection('fruits', ref => ref.where('eat_by', 'array-contains', userId)).valueChanges();
它工作得很好

但我的问题是做了相反的事情;我正在尝试获取没有用户ID的水果,按数组吃。 就像mongo中的
$nin

我需要字段值不在指定的数组运算符中

你以前处理过那件事吗

你是怎么解决的

有什么好的解决办法吗

谢谢你

这里是firebaser

目前云Firestore没有“数组不包含”操作

我强烈建议阅读,因为它解释了为什么不支持此操作。不幸的是,这里提出的解决方案不适用于“数组不包含”操作