当我将一个Date对象写到我的Firestore中时,一切都能正常工作,并且我可以在数据库中看到一个以"timestamp“类型存储的日期。如果我试图将一个Date对象传递给一个云函数,我不知道为什么,但当我将它从云函数存储到firestore DB时,它是一个空对象。 firebase.functions().httpsCallable("myFunction")({date: new Date()}) <---- // this doesn't work 因此,我决定在将Date对象发送到云函数之前,在客户端将其转换为firestore时间戳。如
我试图在Google中创建一个节点,并使用它的唯一id在中创建一个相同名称的文档。
我正在使用谷歌的PHP客户端:
我已经阅读了他们的文档:
这是我的代码:
<?php
use \Google\Cloud\Firestore\FirestoreClient;
use \Google\Cloud\Core\Timestamp;
use \Google\Cloud\Firestore\Transaction as FirestoreTransaction;
use \grptx\Firebase as FirebaseClient;
class FirestoreTest
{
p
我正在使用React.js从Firebase查询文档中的字段。然而,当我尝试获取数据时,我总是得到一个错误。代码、Firestore上的集合和错误消息如下。如何在不遇到此错误的情况下正确查询数据的特定字段?
import React from 'react';
import styled from 'styled-components';
import { firestore } from '../../firebase/firebase.utils';
class Economics extends React.Component {
c
我正在构建一个web应用程序,将用户的个人资料信息存储到Firestore的文档中。我当前将用户显示的名称存储在Firestore中的一个字段下。最近,我刚刚注意到在用户下面有一个displayName字段,我可以用它来获取 var user = firebase.auth().currentUser;
if (user != null) {
name = user.displayName;
} 我想知道是否有可能使用auth中存储的displayName查询用户?与Firestore查询类似: var query = userRef.where("displayed_name&
我已经通过以下nodejs脚本将firebase实时数据迁移到云firestore: var fireastoreDB = admin.firestore();
var db = admin.database();
var ref = db.ref("/users");
let items = [];
ref.once("value", function(snapshot) {
let collectionRef = fireastoreDB.collection("users");
snapshot.forEach(item =>
所以问题是,当我试图使用forEach函数获取详细信息时,它会给出所有用户的详细信息,这些详细信息可以在firestore..let me explain上使用代码进行解释: 下面是我在配置文件页面中获取详细信息的代码: import React from 'react';
import firebase from 'firebase';
const firestore = firebase.firestore();
class ProfilePage extends React.Component {
state = {
prof