Σελίδα 2 από 3

Re: JSON vs MongoDB

Δημοσιεύτηκε: 26 Απρ 2022, 20:43
από talaipwros
Δημοκράτης έγραψε: 26 Απρ 2022, 20:38 μα δεν έχει σχήμα η mongo, αν τα βάλεις σε RDBMS θες σχήμα
εχει document schema, δεν εχει tables
Hi xxxx I the formative there is a requirement to provide a dump of table structure if a database has been used. However mongoDB has no tables as such. What do you suggest I should provide?


Hi xxxx
I will advise you to include the schema
You would need it for an SQL database, but a NoSQL database, like Mongo, uses documents so there are no tables, however, you can export the schema that will show the structure.
Spoiler
MongoDB is schema-less structure but we can enforce the collection by defining the document schema.
Below is the syntax of the MongoDB schema.

1) To show the schema of index collection –

db.name_of_collection.getIndices ()

2) To show the schema of collections –

var schematodo = db.name_of_collection.findOne()
for (var key (Used to show key fields) in schematodo (Used to display schema field of collections)) { print (key, typeof key) ; }

3) Schema structure of document –

{
Properties: {
Field_name: {bsonType (type of document) : string}
Field_name: {bsonType (type of document) : string}
}
}

Parameter Description:

1) Name of collection – This is defined as the name of collection from which we have checked the schema structure of collection and indexes. We can check the schema structure of any collection in MongoDB.

2) getIndices – This is the method in MongoDB used to display schema structure of all indexes from specified schema which was we have used in our command.

3) findOne – This method is used to find single documents from collections. Using this method we also find all collection fields in MongoDB.

Re: JSON vs MongoDB

Δημοσιεύτηκε: 26 Απρ 2022, 20:50
από Δημοκράτης
talaipwros έγραψε: 26 Απρ 2022, 20:43
Δημοκράτης έγραψε: 26 Απρ 2022, 20:38 μα δεν έχει σχήμα η mongo, αν τα βάλεις σε RDBMS θες σχήμα
εχει document schema, δεν εχει tables
Hi xxxx I the formative there is a requirement to provide a dump of table structure if a database has been used. However mongoDB has no tables as such. What do you suggest I should provide?


Hi xxxx
I will advise you to include the schema
You would need it for an SQL database, but a NoSQL database, like Mongo, uses documents so there are no tables, however, you can export the schema that will show the structure.
Spoiler
MongoDB is schema-less structure but we can enforce the collection by defining the document schema.
Below is the syntax of the MongoDB schema.

1) To show the schema of index collection –

db.name_of_collection.getIndices ()

2) To show the schema of collections –

var schematodo = db.name_of_collection.findOne()
for (var key (Used to show key fields) in schematodo (Used to display schema field of collections)) { print (key, typeof key) ; }

3) Schema structure of document –

{
Properties: {
Field_name: {bsonType (type of document) : string}
Field_name: {bsonType (type of document) : string}
}
}

Parameter Description:

1) Name of collection – This is defined as the name of collection from which we have checked the schema structure of collection and indexes. We can check the schema structure of any collection in MongoDB.

2) getIndices – This is the method in MongoDB used to display schema structure of all indexes from specified schema which was we have used in our command.

3) findOne – This method is used to find single documents from collections. Using this method we also find all collection fields in MongoDB.
Την δομή του json σε ζητάει. Η fondone δεν θα επιστρέψει αναγκαστικά ένα documwnt με την πλήρη δομή αλλά απλώς ενα document. Αλλά όλα σου τα documwbts είναι με την ίδια δομή στην collection έχει καλώς ενα findone αρκεί. Αλλιώς πρέπει να βρεις καποιο document που να είναι πλήρες

Re: JSON vs MongoDB

Δημοσιεύτηκε: 26 Απρ 2022, 20:51
από talaipwros
Δημοκράτης έγραψε: 26 Απρ 2022, 20:50
Την δομή του json σε ζητάει.
λογικα ναι

Re: JSON vs MongoDB

Δημοσιεύτηκε: 26 Απρ 2022, 22:18
από foscilis
talaipwros έγραψε: 26 Απρ 2022, 20:33 οποτε ουσιαστικα αν περασω τα στοιχεια ( ειναι περιπου 70 χιλιαδες γραμμες ) σε MongoDB, για να εχει νοημα η φαση πρεπει να κανω τα searches με
τα $search κλπ της mongo αντι να χρησιμοποιω τα pd.DataFrame.groupby Κλπκλπ του παντας.

το μισο module ( και το συνολο του βασικου συγγραματος ) ειναι pandas/numpy

αρα το πουλο, θα πρεπει να εξηγησω γιατι δεν θα βαλω mongoDB.

απο την αλλη λεει Αν κανετε database, δωστε μας το schema . Αρα το θελει;
Η mongodb δεν έχει σχήμα. Απλά πετάς εγγραφές σε JSON και βγάζει άκρη μόνη της, αφού τους κοτσάρει ένα μοναδικό object id.

Είναι απολύτως εφικτό η μία εγγραφή να είναι
{name:"Joe", age:15} και η αμέσως επόμενη να είναι
{name:ISODate("2015-01-01"), age:"to papari mou"}

Βασικά αν σας λένε να χρησιμοποιήσετε MongoDB είναι λίγο μαλάκες.

Re: JSON vs MongoDB

Δημοσιεύτηκε: 26 Απρ 2022, 22:20
από foscilis
talaipwros έγραψε: 26 Απρ 2022, 20:43
var schematodo = db.name_of_collection.findOne()
for (var key (Used to show key fields) in schematodo (Used to display schema field of collections)) { print (key, typeof key) ; }
τραγικοί, παράτα τους

Re: JSON vs MongoDB

Δημοσιεύτηκε: 26 Απρ 2022, 22:23
από talaipwros
foscilis έγραψε: 26 Απρ 2022, 22:20
talaipwros έγραψε: 26 Απρ 2022, 20:43
var schematodo = db.name_of_collection.findOne()
for (var key (Used to show key fields) in schematodo (Used to display schema field of collections)) { print (key, typeof key) ; }
τραγικοί, παράτα τους
αυτο δεν ειναι απο το uni, ειναι απο αλλη πηγη.
Δεν απαιτουν MongoDB, σου δινουν την δυνατοτητα να την επιλεξεις, και να εξηγησεις γιατι την επελεξες ή γιατι οχι.
Με βλεπω τελικα να μην την βαζω αλλα να κανω μια αναλυση του γιατι δεν τη βαζω και να σωνω το output σε JSON files.

Ιδωμεν

Re: JSON vs MongoDB

Δημοσιεύτηκε: 26 Απρ 2022, 22:25
από talaipwros
δε θελω να δωσω ολο το assignment γιατι καπου δεν πρεπει νομιζω

τες πα, στο εστειλα να δεις τον πονο μου

Re: JSON vs MongoDB

Δημοσιεύτηκε: 27 Απρ 2022, 09:19
από klg
talaipwros έγραψε: 26 Απρ 2022, 20:33 οποτε ουσιαστικα αν περασω τα στοιχεια ( ειναι περιπου 70 χιλιαδες γραμμες ) σε MongoDB, για να εχει νοημα η φαση πρεπει να κανω τα searches με
τα $search κλπ της mongo αντι να χρησιμοποιω τα pd.DataFrame.groupby Κλπκλπ του παντας.

το μισο module ( και το συνολο του βασικου συγγραματος ) ειναι pandas/numpy

αρα το πουλο, θα πρεπει να εξηγησω γιατι δεν θα βαλω mongoDB.

απο την αλλη λεει Αν κανετε database, δωστε μας το schema . Αρα το θελει;

σκατα
Από αυτά που γράφεις, φαίνεται να έχεις ένα εξαιρετικά μικρό csv. Δεν ξέρω τι μπορεί να διαχειριστεί το pandas, αλλά το να χρησιμοποιήσεις τον καρκίνο της Mongo για κάτι τέτοιο είναι παντελώς overkill.

Re: JSON vs MongoDB

Δημοσιεύτηκε: 24 Ιουν 2022, 23:22
από talaipwros
φακ γιεα, ουτε μονγκο ουτε τιποτα
JSON file εβαλα και περασα μια χαρουλα το μαθημα.

Re: JSON vs MongoDB

Δημοσιεύτηκε: 25 Ιουν 2022, 09:01
από klg
Οπότε είσαι τώρα και data analyst γιατρέ μου;

Re: JSON vs MongoDB

Δημοσιεύτηκε: 25 Ιουν 2022, 22:51
από talaipwros
προφανως οχι.

Re: JSON vs MongoDB

Δημοσιεύτηκε: 25 Ιουν 2022, 22:58
από Pirate95
μια και εσεις ασχολειστε με κομπιουτεριστικα δε μου λετε γιατι κολλαει το πισι καμια φορα και η οθονη γινεται ασπρη για 1-3 δευτερολεπτα και δεν ανταποκρινεται το συστημα;

Συνηθως αυτο γινεται οταν βλεπω τσοντες σε 4κ αναλυση να ξεχωριζουν και οι μουνοτριχες να πουμε και οσο κολλαει και η οθονη ειναι ασπρη σαν το γαλα, τα "αχ ναι αχ ναι φακ μι χαρντερ" της γκομενας ακουγονται κανονικα πραγμα πολυ ξενερωτο επειδη πρεπει εγω να τη παιζω για μια ασπρη οθονη λες και ειναι κουκλοθεατρο ή ο καραγκιοζης και δε λεει. Αν ξερετε κανενα δωρεαν αντιβαιρους να το διορθωσω ή ντραιβερ απντειτ πειτε μου και θα σας ειμαι αιωνια υποχρεος

Re: JSON vs MongoDB

Δημοσιεύτηκε: 25 Ιουν 2022, 23:01
από Pirate95
Ελπιζω αυτος ο Json να μην εχει συγγενεια με τον Jason τον δολοφονο με τη μασκα εε;

Re: JSON vs MongoDB

Δημοσιεύτηκε: 24 Δεκ 2022, 23:38
από GreekGuy
Pirate95 έγραψε: 25 Ιουν 2022, 22:58 μια και εσεις ασχολειστε με κομπιουτεριστικα δε μου λετε γιατι κολλαει το πισι καμια φορα και η οθονη γινεται ασπρη για 1-3 δευτερολεπτα και δεν ανταποκρινεται το συστημα;

Συνηθως αυτο γινεται οταν βλεπω τσοντες σε 4κ αναλυση να ξεχωριζουν και οι μουνοτριχες να πουμε και οσο κολλαει και η οθονη ειναι ασπρη σαν το γαλα, τα "αχ ναι αχ ναι φακ μι χαρντερ" της γκομενας ακουγονται κανονικα πραγμα πολυ ξενερωτο επειδη πρεπει εγω να τη παιζω για μια ασπρη οθονη λες και ειναι κουκλοθεατρο ή ο καραγκιοζης και δε λεει. Αν ξερετε κανενα δωρεαν αντιβαιρους να το διορθωσω ή ντραιβερ απντειτ πειτε μου και θα σας ειμαι αιωνια υποχρεος
[voca][voca][voca][voca][/voca][/voca][/voca][/voca]

Re: JSON vs MongoDB

Δημοσιεύτηκε: 24 Δεκ 2022, 23:40
από GreekGuy
:goodpost: