mongo works

This commit is contained in:
counterweight 2025-06-01 23:23:55 +02:00
parent ae6ccd559f
commit 125107da50
Signed by: counterweight
GPG key ID: 883EDBAA726BD96C
937 changed files with 205033 additions and 2 deletions

View file

@ -0,0 +1,23 @@
const mongoose = require("mongoose");
const url = "mongodb://devroot:devroot@localhost:27017/fsopen?authSource=admin";
mongoose.set("strictQuery", false);
mongoose.connect(url);
const noteSchema = new mongoose.Schema({
content: String,
important: Boolean,
});
const Note = mongoose.model("Note", noteSchema);
const note = new Note({
content: "HTML is easy",
important: true,
});
note.save().then((result) => {
console.log("note saved!");
mongoose.connection.close();
});