Mongo query nested entity of an document [duplicate]
This question already has an answer here:
MongoDB wildcard in the key of a query
1 answer
How to find MongoDB field name at arbitrary depth
2 answers
I have a collection with the entity schema below:
{
"_id": 1,
"type": "Animals",
"i18n": {
"en": {
"topic": "The dingo is a type of feral dog native to which country?",
"puzzle": "Africa",
"answer": "Australia"
},
"zh": {
"topic": "dingo原居住在哪?",
"puzzle": "非洲",
"answer": "澳大利亚"
},// and other languages
}
}
And I want to query all documents by each languages' topic field just like db.questions.find({'i18n.*.topic':'keyword'})
. Does mongo support this kind of query?
mongodb
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();
}
);
});
});
Nov 14 '18 at 10:09
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:
MongoDB wildcard in the key of a query
1 answer
How to find MongoDB field name at arbitrary depth
2 answers
I have a collection with the entity schema below:
{
"_id": 1,
"type": "Animals",
"i18n": {
"en": {
"topic": "The dingo is a type of feral dog native to which country?",
"puzzle": "Africa",
"answer": "Australia"
},
"zh": {
"topic": "dingo原居住在哪?",
"puzzle": "非洲",
"answer": "澳大利亚"
},// and other languages
}
}
And I want to query all documents by each languages' topic field just like db.questions.find({'i18n.*.topic':'keyword'})
. Does mongo support this kind of query?
mongodb
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();
}
);
});
});
Nov 14 '18 at 10:09
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:
MongoDB wildcard in the key of a query
1 answer
How to find MongoDB field name at arbitrary depth
2 answers
I have a collection with the entity schema below:
{
"_id": 1,
"type": "Animals",
"i18n": {
"en": {
"topic": "The dingo is a type of feral dog native to which country?",
"puzzle": "Africa",
"answer": "Australia"
},
"zh": {
"topic": "dingo原居住在哪?",
"puzzle": "非洲",
"answer": "澳大利亚"
},// and other languages
}
}
And I want to query all documents by each languages' topic field just like db.questions.find({'i18n.*.topic':'keyword'})
. Does mongo support this kind of query?
mongodb
This question already has an answer here:
MongoDB wildcard in the key of a query
1 answer
How to find MongoDB field name at arbitrary depth
2 answers
I have a collection with the entity schema below:
{
"_id": 1,
"type": "Animals",
"i18n": {
"en": {
"topic": "The dingo is a type of feral dog native to which country?",
"puzzle": "Africa",
"answer": "Australia"
},
"zh": {
"topic": "dingo原居住在哪?",
"puzzle": "非洲",
"answer": "澳大利亚"
},// and other languages
}
}
And I want to query all documents by each languages' topic field just like db.questions.find({'i18n.*.topic':'keyword'})
. Does mongo support this kind of query?
This question already has an answer here:
MongoDB wildcard in the key of a query
1 answer
How to find MongoDB field name at arbitrary depth
2 answers
mongodb
mongodb
asked Nov 14 '18 at 9:59
Guisong He
448517
448517
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();
}
);
});
});
Nov 14 '18 at 10:09
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();
}
);
});
});
Nov 14 '18 at 10:09
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 |
add a comment |
0
active
oldest
votes
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes