package
Convert Firebase Cloud Firestore API fields into a usable JavaScript format.
npm install firebase-firestore-fieldsGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
Estimated unpacked size across 1 packages.
5.8 kB
Includes dependencies.
Converts Cloud Firestore REST field values into a usable format. Handles nested objects and arrays.
npm install --save firebase-firestore-fieldsconst convert = require('firebase-firestore-fields');
// typical response from a Cloud Firestore REST endpoint
const response = {
name: 'projects/testproject/databases/(default)/documents/config/2L3sczWg8vZhIZDVgLh5',
fields: {
title: {
stringValue: 'Super cool app!',
},
theme: {
mapValue: {
fields: {
backgroundColor: {
stringValue: '#000000',
},
},
},
},
appEnabled: {
booleanValue: true,
},
},
createTime: '2017-11-24T10:00:12.419673Z',
updateTime:
Returns a type Number (Cloud Firestore returns it as a string).
Returns the latitude & longitude points as an array pair: [latitude, longitude].
Built and maintained with 💛 by Invertase.