mirror of
https://github.com/spacebarchat/server.git
synced 2026-04-26 19:35:20 +00:00
21 lines
530 B
TypeScript
21 lines
530 B
TypeScript
import mongoose from "mongoose";
|
|
import { Long } from "mongodb";
|
|
import { Snowflake } from "discord-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();
|