-
Notifications
You must be signed in to change notification settings - Fork 1
/
playground-3.js
42 lines (39 loc) · 1.26 KB
/
playground-3.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
const throttledQueue = require('throttled-queue');
const {SerializedDocumentArray, SerializedDocument, fromJSON, toJSON, processParsedJoinJSON} = require('@healthtree/firestore-join');
const admin = require('firebase-admin');
admin.initializeApp()
const db = admin.firestore();
const { Timestamp } = require('@google-cloud/firestore');
const fs = require('fs');
const {
get,
difference,
intersection,
sortBy,
chunk
} = require('lodash')
const {DateTime} = require('luxon');
const {doc} = require('mocha/lib/reporters');
const {slug} = require('mocha/lib/utils');
function a({prop1,prop2,prop5}) {
console.log(prop1)
console.log(prop2)
console.log(prop5)
}
function atLeastOneIncluded(checkForInclusion, arrayToCheck) {
for(const checkForInclusionValue of checkForInclusion) {
for(const arrayToCheckValue of arrayToCheck) {
if(checkForInclusionValue === arrayToCheckValue){
return true
}
}
}
}
async function main(n) {
const a = await new SerializedDocumentArray.fromQuery(
db.collection('apps/curehub/medicalResources/normalizations/Observation')
.where('observationMappings', 'array-contains', db.doc('apps/curehub/observationMappings/72253-8'))
)
console.log(a.map(b => b.ref.path))
}
main().then(_ => console.log('done'));