-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdados.mongodb.js
More file actions
47 lines (40 loc) · 933 Bytes
/
dados.mongodb.js
File metadata and controls
47 lines (40 loc) · 933 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
41
42
43
44
45
46
47
use('hotelpet')
db.cliente.insertOne({
nome_tutor: "Dafny Ribeiro",
cpf:"47251787806",
created_at: new Date() ,
updated_at : new Date()
})
use('hotelpet')
db.cliente.find({})
use('hotelpet')
db.pet.insertOne({
nome : "Bob",
especie : "cachorro",
raca : "Lhasa apso",
datanasc :"10/03/2011",
sexo: "M",
porte : "pequeno",
observacoes: "Ele está véio",
peso: 9.0,
created_at: new Date() ,
updated_at : new Date() ,
cpfCliente : '47251787806'
})
use('hotelpet')
db.pet.find()
dataAtual = new Date()
use('hotelpet')
db.estadia.insertOne({
horario_entrada: dataAtual,
horario_saida: dataAtual.setDate(dataAtual.getDate() + 20), //isso significa que o animal não saiu
pet: {
_id: {
$oid: "680a99407c66932cae04f79f"
},
}
})
use('hotelpet')
db.estadia.find()
use('hotelpet')
db.cliente.findOne({cpfCliente:'47251787806'})