File tree Expand file tree Collapse file tree 2 files changed +32
-0
lines changed
firestore-next/test-firestore
firestore-temp/test-firestore Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change 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]
Original file line number Diff line number Diff line change 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]
You can’t perform that action at this time.
0 commit comments