TASIOMIND.DEV — OPERATIONAL▸▸▸FULL STACK DEVELOPER @ GWQ SERVICEPLUS AG▸▸▸FOUNDER — K8SGPT.AI▸▸▸OPEN SOURCE: ACTIVE▸▸▸DISTRIBUTED SYSTEMS / KUBERNETES / AI▸▸▸RUST + GO + PYTHON▸▸▸FIELD TESTED / STATUS — NOMINAL▸▸▸LOCATION: EUROPE/BERLIN▸▸▸TASIOMIND.DEV — OPERATIONAL▸▸▸FULL STACK DEVELOPER @ GWQ SERVICEPLUS AG▸▸▸FOUNDER — K8SGPT.AI▸▸▸OPEN SOURCE: ACTIVE▸▸▸DISTRIBUTED SYSTEMS / KUBERNETES / AI▸▸▸RUST + GO + PYTHON▸▸▸FIELD TESTED / STATUS — NOMINAL▸▸▸LOCATION: EUROPE/BERLIN▸▸▸

MongoDB Basics

May 21, 2014

Begriffe

MongoDBSQL
DatabaseDatabase
CollectionTable
DocumentRow
FieldColumn

CLI Basics

code
show dbs
use mydb
show collections
db

Daten einfuegen

code
db.links.insertOne({
  title: "Courses",
  url: "http://tutsplus.com",
  tags: ["tutorials", "dev"],
  saved_on: new Date(),
});

Daten lesen

code
db.links.find();
db.links.find({ title: "Courses" });

Update

code
db.links.updateOne({ title: "Courses" }, { $set: { title: "New Title" } });

Count

code
db.links.countDocuments();

ObjectId

_id ist einzigartig und enthaelt Zeitanteile. Du kannst damit das Erstellungsdatum ableiten.