我需要获得一个数组的所有可能子集,其中包含最少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) 例如,我的书籍列表中有动态过滤器,我可以设置特定的颜色,作者和类别.此过滤器可以一次设置多种颜色和多个类别.
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)