-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
40 lines (32 loc) · 739 Bytes
/
Copy pathindex.php
File metadata and controls
40 lines (32 loc) · 739 Bytes
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
<?php
require 'vendor/autoload.php';
$cloudMongo = new \MongoODMPHP\Drivers\CloudMongoDriver(
''
);
$db = new \MongoODMPHP\Database($cloudMongo);
$postCollection = $db->collection('posts');
$postCollection
->create()
->setMany()
->continueSaveOnFails()
->documentValidation()
->save(['Somedata']);
$postCollection
->update()
->where('id', '6894989898')
->setMany()
->createIfNotFound()
->save(['somedata']);
$postCollection
->find()
->fields(['cnpj','data','created'])
->where('_id', '84894984994')
->sortAsc('data')
->sortDesc('data')
->limit(500)
->execute();
$postCollection
->delete()
->where('data', '2017-08-05')
->setMany()
->execute();