summary refs log tree commit diff
path: root/src/test/mongo_test.ts
blob: b2cc2bce7af37e5b15b0322a482c1b8af8e21135 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import mongoose from "mongoose";
import { Long } from "mongodb";
import { Snowflake } from "fosscord-server-util";

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").insertOne({ test: Long.fromString(Snowflake.generate().toString()) });
	// .project(undefined)

	console.log(result);
}

main();