• Skip to main content

Rokturis

Pie kā turēties

  • Full Stack
    • JavaScript
    • JS Snipets
    • CSS
    • Git
    • VS Code

Nov 11 2023

Mongo

Table in mongo is collection.

Row = document

Column = value (attribute)

cardinal (n, n) generates additional table.

Foreign Key (FK) Primary Key (PK)

https://josejuansanchez.org/bd/unidad-03-teoria/index.html#relaciones-con-cardinalidad-11

https://openwebinars.net/blog/como-realizar-la-normalizacion-de-bases-de-datos-y-por-que/

Normalization

Todos atributos tiene que ser indivisibles. street, nr, zip

Todo los atributos tiene que ser del mismo tipo en la misma columna.

no deben existir grupos de valores repetidos.

T3

db = db.getSiblingDB(“vet”);

db.getCollection(“animals”).find({},{name:true, _id:false});

animals = db.getCollection(“animals”).find({}).toArray()

clients = db.getCollection(“clients”).find({_id: animals[0].clientId})

newClients = db.getCollection(“clients”).find({}).toArray()

newClients[0]._id

newAnimals = db.getCollection(“animals”).find({clientId: newClients[0]._id})

newerClients = db.getCollection(“clients”).find({fName: “Janis”}).toArray()

newerAnimals = db.getCollection(“animals”).find({clientId: newerClients[0]._id})

newerClients = db.getCollection(“clients”).find({“document.number”:“555654LV”}).toArray() //

newerAnimals = db.getCollection(“animals”).find({“clientId”: newerClients[0]._id})

newerClients = db.getCollection(“clients”).find({“document.number”:/555/}).toArray() // parcial text search

newerAnimals = db.getCollection(“animals”).find({“clientId”: newerClients[0]._id})

Written by meudza · Categorized: Uncategorized

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recipe Rating




Copyright © 2026 · Altitude Pro on Genesis Framework · WordPress · Log in