MongoDB Querying a dataset [duplicate] The Next CEO of Stack OverflowHow to query nested objects?Select nested fields in mongo dbMongoDB vs. CassandraFind objects between two dates MongoDBHow to query MongoDB with “like”?Delete everything in a MongoDB databaseRetrieve only the queried element in an object array in MongoDB collectionQuery for documents where array size is greater than 1How do I drop a MongoDB database from the command line?“Large data” work flows using pandasMongoose Populate Method for QueryingGet the list of query statements in mongodb

Cannot restore registry to default in Windows 10?

Calculating discount not working

How to find if SQL server backup is encrypted with TDE without restoring the backup

Do I need to write [sic] when including a quotation with a number less than 10 that isn't written out?

Man transported from Alternate World into ours by a Neutrino Detector

Why did early computer designers eschew integers?

MT "will strike" & LXX "will watch carefully" (Gen 3:15)?

Find a path from s to t using as few red nodes as possible

Planeswalker Ability and Death Timing

Ising model simulation

Why doesn't Shulchan Aruch include the laws of destroying fruit trees?

How can a day be of 24 hours?

How to unfasten electrical subpanel attached with ramset

Salesforce opportunity stages

Strange use of "whether ... than ..." in official text

The sum of any ten consecutive numbers from a fibonacci sequence is divisible by 11

How can I prove that a state of equilibrium is unstable?

How exploitable/balanced is this homebrew spell: Spell Permanency?

Is it possible to create a QR code using text?

Does the Idaho Potato Commission associate potato skins with healthy eating?

How seriously should I take size and weight limits of hand luggage?

What is the difference between 'contrib' and 'non-free' packages repositories?

Can I cast Thunderwave and be at the center of its bottom face, but not be affected by it?

pgfplots: How to draw a tangent graph below two others?



MongoDB Querying a dataset [duplicate]



The Next CEO of Stack OverflowHow to query nested objects?Select nested fields in mongo dbMongoDB vs. CassandraFind objects between two dates MongoDBHow to query MongoDB with “like”?Delete everything in a MongoDB databaseRetrieve only the queried element in an object array in MongoDB collectionQuery for documents where array size is greater than 1How do I drop a MongoDB database from the command line?“Large data” work flows using pandasMongoose Populate Method for QueryingGet the list of query statements in mongodb










0
















This question already has an answer here:



  • How to query nested objects?

    2 answers



  • Select nested fields in mongo db

    2 answers



Out of the dataset, I want to get the list which matches with my condition. My condition is: make is Skoda and Model is Octavia.



Below image shows how it looks like, before applying the condition.
enter image description here



But after I apply my condition, only id is shown, not the data from the list. This is how it looks like
enter image description here



Can anybody help me to sort out that?










share|improve this question















marked as duplicate by Neil Lunn mongodb
Users with the  mongodb badge can single-handedly close mongodb questions as duplicates and reopen them as needed.

StackExchange.ready(function()
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();

);
);
);
Mar 8 at 23:41


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


















  • .find() method takes two JS objects as parameters: first one represents a query and second represents projection so you should put your filtering condition inside of the first object like find( Make: '...', 'Model': ..., Model: 1) docs.mongodb.com/manual/reference/method/db.collection.find/…

    – mickl
    Mar 8 at 19:11











  • db.getCollection('Assgcars').find(Model:"Panda", Manufacturer:1,_id:1) , this one doesn't give any result. I'm afraid the structure of the data stored is different from normal. If you look at image 1

    – Viraj Wickramasinghe
    Mar 8 at 19:51











  • Those fields are all within a single key named "0". .find( "0.Model": "Octavia", "0.Manufacturer": "Skoda" ). Or to "select just the fields": it's .find( , "0.Model": 1 ). Note the "0" key in your document was probably inserted in error. Also Please do not insert screenshots Your queries and code are "text", just like the rest of the words you typed in. You should have been given a message warning you about that when you posted.

    – Neil Lunn
    Mar 8 at 23:47











  • This .find( "0.Model": "Octavia", "0.Manufacturer": "Skoda" ) doesn't result in anything

    – Viraj Wickramasinghe
    Mar 9 at 3:53











  • What if, when there are sub elements similar as in 0 in other 1,2,3 as well. How to get their results/? Like using ForEach

    – Viraj Wickramasinghe
    Mar 9 at 3:53
















0
















This question already has an answer here:



  • How to query nested objects?

    2 answers



  • Select nested fields in mongo db

    2 answers



Out of the dataset, I want to get the list which matches with my condition. My condition is: make is Skoda and Model is Octavia.



Below image shows how it looks like, before applying the condition.
enter image description here



But after I apply my condition, only id is shown, not the data from the list. This is how it looks like
enter image description here



Can anybody help me to sort out that?










share|improve this question















marked as duplicate by Neil Lunn mongodb
Users with the  mongodb badge can single-handedly close mongodb questions as duplicates and reopen them as needed.

StackExchange.ready(function()
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();

);
);
);
Mar 8 at 23:41


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


















  • .find() method takes two JS objects as parameters: first one represents a query and second represents projection so you should put your filtering condition inside of the first object like find( Make: '...', 'Model': ..., Model: 1) docs.mongodb.com/manual/reference/method/db.collection.find/…

    – mickl
    Mar 8 at 19:11











  • db.getCollection('Assgcars').find(Model:"Panda", Manufacturer:1,_id:1) , this one doesn't give any result. I'm afraid the structure of the data stored is different from normal. If you look at image 1

    – Viraj Wickramasinghe
    Mar 8 at 19:51











  • Those fields are all within a single key named "0". .find( "0.Model": "Octavia", "0.Manufacturer": "Skoda" ). Or to "select just the fields": it's .find( , "0.Model": 1 ). Note the "0" key in your document was probably inserted in error. Also Please do not insert screenshots Your queries and code are "text", just like the rest of the words you typed in. You should have been given a message warning you about that when you posted.

    – Neil Lunn
    Mar 8 at 23:47











  • This .find( "0.Model": "Octavia", "0.Manufacturer": "Skoda" ) doesn't result in anything

    – Viraj Wickramasinghe
    Mar 9 at 3:53











  • What if, when there are sub elements similar as in 0 in other 1,2,3 as well. How to get their results/? Like using ForEach

    – Viraj Wickramasinghe
    Mar 9 at 3:53














0












0








0









This question already has an answer here:



  • How to query nested objects?

    2 answers



  • Select nested fields in mongo db

    2 answers



Out of the dataset, I want to get the list which matches with my condition. My condition is: make is Skoda and Model is Octavia.



Below image shows how it looks like, before applying the condition.
enter image description here



But after I apply my condition, only id is shown, not the data from the list. This is how it looks like
enter image description here



Can anybody help me to sort out that?










share|improve this question

















This question already has an answer here:



  • How to query nested objects?

    2 answers



  • Select nested fields in mongo db

    2 answers



Out of the dataset, I want to get the list which matches with my condition. My condition is: make is Skoda and Model is Octavia.



Below image shows how it looks like, before applying the condition.
enter image description here



But after I apply my condition, only id is shown, not the data from the list. This is how it looks like
enter image description here



Can anybody help me to sort out that?





This question already has an answer here:



  • How to query nested objects?

    2 answers



  • Select nested fields in mongo db

    2 answers







mongodb mongodb-query






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 8 at 23:50









Neil Lunn

101k23178187




101k23178187










asked Mar 8 at 18:59









Viraj WickramasingheViraj Wickramasinghe

86




86




marked as duplicate by Neil Lunn mongodb
Users with the  mongodb badge can single-handedly close mongodb questions as duplicates and reopen them as needed.

StackExchange.ready(function()
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();

);
);
);
Mar 8 at 23:41


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.









marked as duplicate by Neil Lunn mongodb
Users with the  mongodb badge can single-handedly close mongodb questions as duplicates and reopen them as needed.

StackExchange.ready(function()
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();

);
);
);
Mar 8 at 23:41


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.














  • .find() method takes two JS objects as parameters: first one represents a query and second represents projection so you should put your filtering condition inside of the first object like find( Make: '...', 'Model': ..., Model: 1) docs.mongodb.com/manual/reference/method/db.collection.find/…

    – mickl
    Mar 8 at 19:11











  • db.getCollection('Assgcars').find(Model:"Panda", Manufacturer:1,_id:1) , this one doesn't give any result. I'm afraid the structure of the data stored is different from normal. If you look at image 1

    – Viraj Wickramasinghe
    Mar 8 at 19:51











  • Those fields are all within a single key named "0". .find( "0.Model": "Octavia", "0.Manufacturer": "Skoda" ). Or to "select just the fields": it's .find( , "0.Model": 1 ). Note the "0" key in your document was probably inserted in error. Also Please do not insert screenshots Your queries and code are "text", just like the rest of the words you typed in. You should have been given a message warning you about that when you posted.

    – Neil Lunn
    Mar 8 at 23:47











  • This .find( "0.Model": "Octavia", "0.Manufacturer": "Skoda" ) doesn't result in anything

    – Viraj Wickramasinghe
    Mar 9 at 3:53











  • What if, when there are sub elements similar as in 0 in other 1,2,3 as well. How to get their results/? Like using ForEach

    – Viraj Wickramasinghe
    Mar 9 at 3:53


















  • .find() method takes two JS objects as parameters: first one represents a query and second represents projection so you should put your filtering condition inside of the first object like find( Make: '...', 'Model': ..., Model: 1) docs.mongodb.com/manual/reference/method/db.collection.find/…

    – mickl
    Mar 8 at 19:11











  • db.getCollection('Assgcars').find(Model:"Panda", Manufacturer:1,_id:1) , this one doesn't give any result. I'm afraid the structure of the data stored is different from normal. If you look at image 1

    – Viraj Wickramasinghe
    Mar 8 at 19:51











  • Those fields are all within a single key named "0". .find( "0.Model": "Octavia", "0.Manufacturer": "Skoda" ). Or to "select just the fields": it's .find( , "0.Model": 1 ). Note the "0" key in your document was probably inserted in error. Also Please do not insert screenshots Your queries and code are "text", just like the rest of the words you typed in. You should have been given a message warning you about that when you posted.

    – Neil Lunn
    Mar 8 at 23:47











  • This .find( "0.Model": "Octavia", "0.Manufacturer": "Skoda" ) doesn't result in anything

    – Viraj Wickramasinghe
    Mar 9 at 3:53











  • What if, when there are sub elements similar as in 0 in other 1,2,3 as well. How to get their results/? Like using ForEach

    – Viraj Wickramasinghe
    Mar 9 at 3:53

















.find() method takes two JS objects as parameters: first one represents a query and second represents projection so you should put your filtering condition inside of the first object like find( Make: '...', 'Model': ..., Model: 1) docs.mongodb.com/manual/reference/method/db.collection.find/…

– mickl
Mar 8 at 19:11





.find() method takes two JS objects as parameters: first one represents a query and second represents projection so you should put your filtering condition inside of the first object like find( Make: '...', 'Model': ..., Model: 1) docs.mongodb.com/manual/reference/method/db.collection.find/…

– mickl
Mar 8 at 19:11













db.getCollection('Assgcars').find(Model:"Panda", Manufacturer:1,_id:1) , this one doesn't give any result. I'm afraid the structure of the data stored is different from normal. If you look at image 1

– Viraj Wickramasinghe
Mar 8 at 19:51





db.getCollection('Assgcars').find(Model:"Panda", Manufacturer:1,_id:1) , this one doesn't give any result. I'm afraid the structure of the data stored is different from normal. If you look at image 1

– Viraj Wickramasinghe
Mar 8 at 19:51













Those fields are all within a single key named "0". .find( "0.Model": "Octavia", "0.Manufacturer": "Skoda" ). Or to "select just the fields": it's .find( , "0.Model": 1 ). Note the "0" key in your document was probably inserted in error. Also Please do not insert screenshots Your queries and code are "text", just like the rest of the words you typed in. You should have been given a message warning you about that when you posted.

– Neil Lunn
Mar 8 at 23:47





Those fields are all within a single key named "0". .find( "0.Model": "Octavia", "0.Manufacturer": "Skoda" ). Or to "select just the fields": it's .find( , "0.Model": 1 ). Note the "0" key in your document was probably inserted in error. Also Please do not insert screenshots Your queries and code are "text", just like the rest of the words you typed in. You should have been given a message warning you about that when you posted.

– Neil Lunn
Mar 8 at 23:47













This .find( "0.Model": "Octavia", "0.Manufacturer": "Skoda" ) doesn't result in anything

– Viraj Wickramasinghe
Mar 9 at 3:53





This .find( "0.Model": "Octavia", "0.Manufacturer": "Skoda" ) doesn't result in anything

– Viraj Wickramasinghe
Mar 9 at 3:53













What if, when there are sub elements similar as in 0 in other 1,2,3 as well. How to get their results/? Like using ForEach

– Viraj Wickramasinghe
Mar 9 at 3:53






What if, when there are sub elements similar as in 0 in other 1,2,3 as well. How to get their results/? Like using ForEach

– Viraj Wickramasinghe
Mar 9 at 3:53













0






active

oldest

votes

















0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes

Popular posts from this blog

How to get text form Clipboard with JavaScript in Firefox 56?How to validate an email address in JavaScript?How do JavaScript closures work?How do I remove a property from a JavaScript object?How do you get a timestamp in JavaScript?How do I copy to the clipboard in JavaScript?How do I include a JavaScript file in another JavaScript file?Get the current URL with JavaScript?How to replace all occurrences of a string in JavaScriptHow to check whether a string contains a substring in JavaScript?How do I remove a particular element from an array in JavaScript?

Can't initialize raids on a new ASUS Prime B360M-A motherboard2019 Community Moderator ElectionSimilar to RAID config yet more like mirroring solution?Can't get motherboard serial numberWhy does the BIOS entry point start with a WBINVD instruction?UEFI performance Asus Maximus V Extreme

List of MPs elected to the English parliament in 1640 (April) Contents List of constituencies and members See also Notes References Navigation menueNational Archives – The Glynde Place ArchivesCobbett's Parliamentary history of England, from the Norman Conquest in 1066 to the year 1803'Aldermen in Parliament', The Aldermen of the City of London: Temp. Henry III – 1912onepage&q&f&#61, false 229