db.posts.insert({
title: "Hello World",
"2d": [1,2],
"3d": [3,4,5],
"4d": [6,7,8,9],
"6d: [1,2,3,4,5,6]
});
Each document can have only the 2d column, or just the 3d column, or just the both, or just 4d and 2d, etc. How do I find documents which has that specific column?
SELECT * FROM posts where posts.hascolumn=2d
^Just for demonstration.
You can use
db.posts.find({"2d" : {$exists:true})