MongoDB Querying a dataset [duplicate] Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!How 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 Querying
First console to have temporary backward compatibility
How to Make a Beautiful Stacked 3D Plot
Where are Serre’s lectures at Collège de France to be found?
Using et al. for a last / senior author rather than for a first author
What font is "z" in "z-score"?
Can an alien society believe that their star system is the universe?
Is it ethical to give a final exam after the professor has quit before teaching the remaining chapters of the course?
Why are there no cargo aircraft with "flying wing" design?
How do I find out the mythology and history of my Fortress?
Is there a kind of relay only consumes power when switching?
2001: A Space Odyssey's use of the song "Daisy Bell" (Bicycle Built for Two); life imitates art or vice-versa?
What is the meaning of the new sigil in Game of Thrones Season 8 intro?
Would "destroying" Wurmcoil Engine prevent its tokens from being created?
Fundamental Solution of the Pell Equation
How do pianists reach extremely loud dynamics?
How does the math work when buying airline miles?
What causes the direction of lightning flashes?
How could we fake a moon landing now?
Why are the trig functions versine, haversine, exsecant, etc, rarely used in modern mathematics?
Does classifying an integer as a discrete log require it be part of a multiplicative group?
How to compare two different files line by line in unix?
Is "Reachable Object" really an NP-complete problem?
Do I really need to have a message in a novel to appeal to readers?
Circuit to "zoom in" on mV fluctuations of a DC signal?
MongoDB Querying a dataset [duplicate]
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)
Data science time! April 2019 and salary with experience
The Ask Question Wizard is Live!How 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 Querying
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
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?
mongodb mongodb-query
marked as duplicate by Neil Lunn
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.
add a comment |
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?
mongodb mongodb-query
marked as duplicate by Neil Lunn
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
add a comment |
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?
mongodb mongodb-query
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
mongodb mongodb-query
edited Mar 8 at 23:50
Neil Lunn
101k23181188
101k23181188
asked Mar 8 at 18:59
Viraj WickramasingheViraj Wickramasinghe
86
86
marked as duplicate by Neil Lunn
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
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
add a comment |
.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
add a comment |
0
active
oldest
votes
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
.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