Firebase Admin查询:集合where documentId()IN ID数组

时间:2020-01-31 08:56:38

标签: node.js firebase google-cloud-firestore google-cloud-functions firebase-admin

此查询适用于Web Firebase SDK:

firestore.collection("recipes").where(firebase.firestore.FieldValue.documentId(), 'in', ['recipe12','recipe17']).get()

但是在我的具有“ firebase-admin”功能的云函数中,出现此错误:

错误:firebase.firestore.FieldValue.documentId()的对应值必须为 字符串或DocumentReference。

1 个答案:

答案 0 :(得分:2)

在Web和管理SDK中均为FieldValue.documentId()

网站:https://firebase.google.com/docs/reference/js/firebase.firestore.FieldPath.html#documentid

Adimin:https://googleapis.dev/nodejs/firestore/latest/FieldPath.html#.documentId

undefined应该是data = spark.read.parquet("/my_parquet_table/year=2020/month=01/day=31/") pdata = data.reshuffle(5) # here number of partition I put 5, but you can determine this number per data you receive every day #use pdata for further operation