Eliaxie / SMBUD-NoSQL-Project

MIT License
0 stars 1 forks source link

ISODate #1

Closed Eliaxie closed 1 year ago

Eliaxie commented 1 year ago

ora abbiamo le date come tipo Date che poi viene convertito in stringa da JSON.stringify(), tipo

creation_date: "2022-03-30T09:12:46Z"

Come vogliamo averla per l'import?

Eliaxie commented 1 year ago

Leggo che serve qualcosa di questo tipo https://stackoverflow.com/questions/26901294/how-to-insert-date-into-mongo-from-json-file

{
  "createdAt": { "$date": "2018-11-10T22:26:12.111Z" }
}
Eliaxie commented 1 year ago

https://github.com/Eliaxie/SMBUD-NoSQL-Project/commit/df141363e88ed0f452d563ac463866bd3dd8e053 sembra funzionare

Eliaxie commented 1 year ago

Screenshot (20) questo è quello che si vede da Compass

Plinkett commented 1 year ago

Mi sa che in effetti devi usare il tipo $data di MongoDB. Quindi sì, dovremmo usare $data, cioè potrebbe essere una stringa ma meglio $data.

Eliaxie commented 1 year ago

Screenshot (20) questo è quello che si vede da Compass

così va bene?

Plinkett commented 1 year ago

Sì, ti ha preso il tipo $data, non è più una stringa. Almeno credo (dovrei vedere bene domani quando faccio le query...)

Eliaxie commented 1 year ago

Okay, se è tutto a posto chiudete se no pingatemi che fixo

Il sab 12 nov 2022, 16:26 Plinkett @.***> ha scritto:

Sì, ti ha preso il tipo $data, non è più una stringa. Almeno credo (dovrei vedere bene domani quando faccio le query...)

— Reply to this email directly, view it on GitHub https://github.com/Eliaxie/SMBUD-NoSQL-Project/issues/1#issuecomment-1312505971, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGPXFJ5EGHCILWUYJJLQP7LWH6ZMHANCNFSM6AAAAAAR6LMPBA . You are receiving this because you were assigned.Message ID: @.***>

Plinkett commented 1 year ago

Funziona, thanksssss