Posts by Jorge C. Bernhard Tautz • 429 points
25 posts
-
0
votes1
answer295
viewsA: Slow query about Mongodb with index
The order of attributes in the index and query influence the search. You have an index with three levels and are skipping one of them in the query. Two attempts: Try creating another index that does…
mongodbanswered Jorge C. Bernhard Tautz 429 -
1
votes1
answer72
viewsA: Doubt about Index for Boolean Fields - Mongodb
In the end the index will have two entries (0 and 1 or true and false) I believe it makes no difference. No doubt the boolean values will take up less disk space, which will leave you with a smaller…
-
0
votes1
answer118
viewsA: Mongo indexes
Short answer to your question: yes, each combination needs an index. Considerations: Consider the order in which fields are passed in the query. An index {a:1,b:1} is different from an index…
-
0
votes1
answer231
viewsA: Mongodb get records with priority
Following the specifications you gave in the comment, I would add all the information in a single Collection. It seems to me that you have three lists as input data. You could put the priority as a…
mongodbanswered Jorge C. Bernhard Tautz 429 -
1
votes1
answer232
viewsA: Mongodb seeks to return internal arrays
To do this you need to use an aggregation (I used teste as the name of Collection): db.teste.aggregate( {$unwind: "$produtos"}, {$project: {"_id" : "$produtos._id", "nome": "$produtos.nome"}} ) The…
-
1
votes1
answer58
viewsA: Create different indexes for different searches - Mongodb
Why are you using such indexes text? Their main idea is to search for text within a document string attribute. They are costly to create and maintain. Also, as you noticed, you can only create a…
-
0
votes1
answer42
viewsA: I’m not able to load just one element of an array at a lower level on mongodb
From what I understand you want to return only the helpers(s) of some employee. find will always return a document from Collection, returning the document and the structure to support your…
mongodbanswered Jorge C. Bernhard Tautz 429 -
1
votes1
answer28
viewsA: Nested Documents
How could I update the street number of "Vila do Chavez" without having an identifier? You answered the question by asking her, "... update the street number of 'Vila do Chavez' ..." you used the…
-
0
votes1
answer43
viewsA: Register unique embedded documents
Instead of $push, try using the $addToSet operator (by $push I assumed your field is an array). The single index will cause you to not have two documents with the same value in the field, it will…
mongodbanswered Jorge C. Bernhard Tautz 429 -
1
votes1
answer524
viewsA: Backup and Restor Mongodb - ways
To official documentation page mentions several ways. Disregarding the official maintenance tool, the Cloud Manager which is paid for per server, you have two options (three depending on the…
-
2
votes1
answer163
viewsA: Doubt in modeling Mongodb
Following your requirements you could have a promotion document, in which gender is an attribute. Something like this: { "_id" : "ObjectId("507f191e810c19729de860ea")", "tituloPromocao" : "Promoção…
-
1
votes1
answer2250
viewsA: Creating and changing users and permissions
About the writeConcern parameter: Before talking about the commands I will leave here a description of the object writeConcern, which is an optional parameter of all commands below. It indicates how…
mongodbanswered Jorge C. Bernhard Tautz 429 -
3
votes1
answer5482
viewsA: How to export and import a database
Option 1: mongodump and mongorestore. These are two tools that are in the bin directory of the Mongodb installation. You could write a script to automate the dump on one side, and Restore on the…
mongodbanswered Jorge C. Bernhard Tautz 429 -
1
votes1
answer108
viewsA: Delete single quotes, double quotes, commas, line breaks and records with the same value as a field in mongodb
I’ll copy your code and comment to try to understand what you’re doing and help you: var registro; // para cada documento na collection "TweetsBR_1_copy"…
mongodbanswered Jorge C. Bernhard Tautz 429 -
1
votes1
answer251
viewsA: Mongodb for multi-user data
Paul, I will bring the recommendation I put in the answer to this question here: Always think about how data will be accessed/entered/updated. Unlike relational databases, which are agnostic…
-
1
votes1
answer116
viewsA: Mongodb Driver Fields Exclude
I don’t know C#directly, but what you need to check is the support for your driver projections. In the Quick tour from the documentation of the c# driver of Mongo there is a section on projection,…
-
1
votes1
answer634
viewsA: 1:N and N:M Mongodb parse-server relationship
First of all there is no specific rule for modeling on noSQL banks. What you find are recommendations in the database documentation. Talking about Mongodb, there is a great general recommendation to…
-
0
votes1
answer147
viewsA: Hybrid deployments with PHP Laravel Mysql + Mongodb
The answer to your final question is: it depends. If you want to do a hybrid implementation, no problem, think carefully about the justifications for doing it (or not doing it).…
-
2
votes1
answer74
viewsA: Mongodb stops inserting documents
You have exceeded the maximum document size limit in mongodb, a single document can have a maximum of 16MB. Your document is at 16777950 bytes, I took the information from Exception, the line where…
-
0
votes1
answer970
viewsA: How to update to Node.js and Mongoose
Hello, you are trying to update an array (form) within an array (sections), right? For this you have to use the positional operator ($). I don’t know Mongoose or Node.js, I can help you with…
-
0
votes1
answer95
viewsA: Quiz Database Schema for Mongodb
The schema design on Mongo should mainly take into account the following question: how you will access the data? Considering that you will list the quizzes, without searching the user is better to…
mongodbanswered Jorge C. Bernhard Tautz 429 -
0
votes1
answer9
viewsA: When I store the ID it disappears with some numbers
I see two exits: Save your ID as String, which will make sense if you won’t do arithmetic operations on the bank like this value (add, average...). Save your value as Decimal128 which is the data…
-
1
votes1
answer75
viewsA: Sharding in Mongodb
The first sentence of sharding documentation answers your question: "In sharded clusters, you can create Zones of sharded data based on the Shard key. You can Associate each zone with one or more…
mongodbanswered Jorge C. Bernhard Tautz 429 -
-1
votes2
answers61
viewsA: Mongodb not installed
You have given little information in your question, but based on what is described: You will not lose the data if you re-install the database and use the same dbpath. Do dump you mean use…
mongodbanswered Jorge C. Bernhard Tautz 429 -
2
votes2
answers113
viewsA: Querie mongodb with regex
I think you’re looking for something like string search by approximate result (try looking for "approximative string matching"). Thinking for a moment, if you search for the whole number there is no…