相关疑难解决方法(0)

找到阵列中所有可能的子集组合?

我需要获得一个数组的所有可能子集,其中包含最少2个项目和未知最大值.有人可以帮我一点吗?

说我有这个......

[1,2,3]
Run Code Online (Sandbox Code Playgroud)

......我怎么得到这个?

[
    [1,2]
    , [1,3]
    , [2,3]
    , [1,2,3]
]
Run Code Online (Sandbox Code Playgroud)

javascript arrays subset

33
推荐指数
5
解决办法
3万
查看次数

Firestore:多个条件where子句

例如,我的书籍列表中有动态过滤器,我可以设置特定的颜色,作者和类别.此过滤器可以一次设置多种颜色和多个类别.

   Book > Red, Blue > Adventure, Detective.
Run Code Online (Sandbox Code Playgroud)

如何有条件地添加"where"?

  firebase
    .firestore()
    .collection("book")
    .where("category", "==", )
    .where("color", "==", )
    .where("author", "==", )

    .orderBy("date")
    .get()
    .then(querySnapshot => {...
Run Code Online (Sandbox Code Playgroud)

javascript firebase google-cloud-firestore

12
推荐指数
4
解决办法
8554
查看次数