Skip to content

Commit 728baf9

Browse files
committed
JT feedback
1 parent 619d9dd commit 728baf9

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

source/includes/databases-collections/time-series.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
require 'vendor/autoload.php';
33

4-
$uri = getenv('MONGODB_URI') ?: throw new RuntimeException('Set the MONGODB_URI variable to your Atlas URI that connects to the sample dataset');
4+
$uri = getenv('MONGODB_URI') ?: 'mongodb://localhost:27017';
55
$client = new MongoDB\Client($uri);
66

77
// Creates a time series collection to store precipitation data
@@ -12,7 +12,7 @@
1212
'timeseries' => [
1313
'timeField' => 'timestamp',
1414
'metaField' => 'location',
15-
'granularity' => 'minutes'
15+
'granularity' => 'minutes',
1616
]
1717
];
1818

@@ -36,13 +36,13 @@
3636
[
3737
'precipitation_mm' => 0.5,
3838
'location' => 'New York City',
39-
'timestamp' => new MongoDB\BSON\UTCDateTime(1694829060000)
39+
'timestamp' => new MongoDB\BSON\UTCDateTime(1694829060000),
4040
],
4141
[
4242
'precipitation_mm' => 2.8,
4343
'location' => 'New York City',
44-
'timestamp' => new MongoDB\BSON\UTCDateTime(1695594780000)
45-
]
44+
'timestamp' => new MongoDB\BSON\UTCDateTime(1695594780000),
45+
],
4646
]
4747
);
4848
// end-insert-ts

0 commit comments

Comments
 (0)