Skip to content

Commit 496a426

Browse files
committed
run snippets
1 parent dcc9a56 commit 496a426

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// This snippet file was generated by processing the source file:
2+
// ./firestore-next/test.firestore.js
3+
//
4+
// To update the snippets in this file, edit the source and then run
5+
// 'npm run snippets'.
6+
7+
// [START stages_expressions_example_modular]
8+
const trailing30Days = constant(Timestamp.now().toMillis())
9+
.unixMillisToTimestamp()
10+
.timestampSubtract("day", 30);
11+
const snapshot = await execute(db.pipeline()
12+
.collection("productViews")
13+
.where(field("viewedAt").greaterThan(trailing30Days))
14+
.aggregate(field("productId").countDistinct().as("uniqueProductViews"))
15+
);
16+
// [END stages_expressions_example_modular]
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// This snippet file was generated by processing the source file:
2+
// ./firestore-temp/test.firestore.js
3+
//
4+
// To update the snippets in this file, edit the source and then run
5+
// 'npm run snippets'.
6+
7+
// [START stages_expressions_example_modular]
8+
const trailing30Days = constant(Timestamp.now().toMillis())
9+
.unixMillisToTimestamp()
10+
.timestampSubtract("day", 30);
11+
const snapshot = await db.pipeline()
12+
.collection("productViews")
13+
.where(field("viewedAt").greaterThan(trailing30Days))
14+
.aggregate(field("productId").countDistinct().as("uniqueProductViews"))
15+
.execute();
16+
// [END stages_expressions_example_modular]

0 commit comments

Comments
 (0)