summary refs log tree commit diff
path: root/src/test/mongo_test.ts
blob: ad2901984fc6430924c3d53918d930121c214660 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import mongoose from "mongoose";

async function main() {
	const conn = await mongoose.createConnection(
		"mongodb://localhost:27017/lambert?readPreference=secondaryPreferred",
		{
			useNewUrlParser: true,
			useUnifiedTopology: false,
		}
	);
	console.log("connected");
	const result = await conn
		.collection("users")
		.find({ $or: [{ email: "samuel.scheit@gmail.com" }, { phone: "samuel.scheit@gmail.com" }] })
		.toArray();
	// .project(undefined)

	console.log(result);
}

main();