armand pirvu
2018-12-05 03:02:06 UTC
Hello
A noob with some questions. Any help is appreciated
Thks
-- Armand
case 1:
db.mymongo1_col1.insert( { item: "journal", qty: 25, size: { h: 14, w: 21,
uom: "cm" }, status: "A" });
db.mymongo1_col1.insert( { item: "notebook", qty: 25, size: { h: 14, w: 21,
uom: "cm" }, status: "A" });
db.mymongo1_col1.insert( { item: "notebook", qty: 25, size: { h: 14, w: 20,
uom: "cm" }, status: "A" });
25, "size" : { "h" : 14, "w" : 21, "uom" : "cm" }, "status" : "A" }
{ "_id" : ObjectId("5c072f6834943268d8387edd"), "item" : "notebook", "qty"
: 25, "size" : { "h" : 14, "w" : 21, "uom" : "cm" }, "status" : "A" }
{ "_id" : ObjectId("5c072f6834943268d8387ede"), "item" : "notebook", "qty"
: 25, "size" : { "h" : 14, "w" : 20, "uom" : "cm" }, "status" : "A" }
case 2:
db.mymongo1_col2.insert({"_col1" : "3"}, {"_col2" : "col2_3", "_col3" :
"col3_3"});
db.mymongo1_col2.insert({"_col1" : "3"}, {"_col2" : "col2_3", "_col3" :
"col3_3"});
db.mymongo1_col2.insert({"_col1" : "3"}, {"_col2" : "col2_3", "_col3" :
"col3_4"});
{ "_id" : ObjectId("5c0734a434943268d8387ee0"), "_col1" : "3" }
{ "_id" : ObjectId("5c0736fa34943268d8387ee1"), "_col1" : "3" }
case 3:
db.mymongo1_col3.insert({"_col1" : "3"}, "fld2": {"_col2" : "col2_3",
"_col3" : "col3_3"});
db.mymongo1_col3.insert({"_col1" : "3"}, "fld2": {"_col2" : "col2_3",
"_col3" : "col3_3"});
2018-12-04T21:22:51.497-0500 E QUERY [thread1] SyntaxError: missing )
after argument list @(shell):1:47
db.mymongo1_col3.insert({"_col1" : "3"}, "fld2": {"_col2" : "col2_3",
"_col3" : "col3_3"}});
db.mymongo1_col3.insert({"_col1" : "3"}, "fld2": {"_col2" : "col2_3",
"_col3" : "col3_3"}});
So some questions
Case 2 - why I don't see the embedded doc ? See the last on has "_col3" :
"col3_4"
Case 3 fails but Case 2 succeeded the only diff is prepending "fld2" from
what I can see. why ? However I think I see. see later case 3 in which i
start with two embeded docs vs case 5 am I right ?
db.mymongo1_col3.insert({"_col1" : "3"}, "fld2": {"_col2" : "col2_3",
"_col3" : "col3_3"});
db.mymongo1_col3.insert({"_col1" : "3"}, "fld2": {"_col2" : "col2_3",
"_col3" : "col3_4"});
Case 4
db.mymongo1_col4.insert( { _col1: "3" , size: { "_col2" : "col2_3", "_col3"
: "col3_3" }});
db.mymongo1_col4.insert( { _col1: "3", size: { "_col2" : "col2_3", "_col3"
: "col3_3" }});
db.mymongo1_col4.insert( { _col1: "3" , size: { "_col2" : "col2_3", "_col3"
: "col3_4"}});
"_col2" : "col2_3", "_col3" : "col3_3" } }
{ "_id" : ObjectId("5c073bb834943268d8387efa"), "_col1" : "3", "size" : {
"_col2" : "col2_3", "_col3" : "col3_3" } }
{ "_id" : ObjectId("5c073bb834943268d8387efb"), "_col1" : "3", "size" : {
"_col2" : "col2_3", "_col3" : "col3_4" } }
Case 5
db.mymongo1_col5.insert( { _col1: "3" , "fld2": { "_col2" : "col2_3",
"_col3" : "col3_3" }});
db.mymongo1_col5.insert( { _col1: "3", "fld2": { "_col2" : "col2_3",
"_col3" : "col3_3" }});
db.mymongo1_col5.insert( { _col1: "3", "fld2": { "_col2" : "col2_3",
"_col3" : "col3_4" }});
"_col2" : "col2_3", "_col3" : "col3_3" } }
{ "_id" : ObjectId("5c073bf034943268d8387efd"), "_col1" : "3", "fld2" : {
"_col2" : "col2_3", "_col3" : "col3_3" } }
{ "_id" : ObjectId("5c073bf034943268d8387efe"), "_col1" : "3", "fld2" : {
"_col2" : "col2_3", "_col3" : "col3_4" } }
--
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.
For other MongoDB technical support options, see: https://docs.mongodb.com/manual/support/
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user+***@googlegroups.com.
To post to this group, send email to mongodb-***@googlegroups.com.
Visit this group at https://groups.google.com/group/mongodb-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/CAKrrPpiOTxxQmrOrfKULwi0o%2BcUg7aAKcPU08LOWZ6K%2BZMdA8g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
A noob with some questions. Any help is appreciated
Thks
-- Armand
case 1:
db.mymongo1_col1.insert( { item: "journal", qty: 25, size: { h: 14, w: 21,
uom: "cm" }, status: "A" });
db.mymongo1_col1.insert( { item: "notebook", qty: 25, size: { h: 14, w: 21,
uom: "cm" }, status: "A" });
db.mymongo1_col1.insert( { item: "notebook", qty: 25, size: { h: 14, w: 20,
uom: "cm" }, status: "A" });
db.mymongo1_col1.find();
{ "_id" : ObjectId("5c072f6834943268d8387edc"), "item" : "journal", "qty" :25, "size" : { "h" : 14, "w" : 21, "uom" : "cm" }, "status" : "A" }
{ "_id" : ObjectId("5c072f6834943268d8387edd"), "item" : "notebook", "qty"
: 25, "size" : { "h" : 14, "w" : 21, "uom" : "cm" }, "status" : "A" }
{ "_id" : ObjectId("5c072f6834943268d8387ede"), "item" : "notebook", "qty"
: 25, "size" : { "h" : 14, "w" : 20, "uom" : "cm" }, "status" : "A" }
case 2:
db.mymongo1_col2.insert({"_col1" : "3"}, {"_col2" : "col2_3", "_col3" :
"col3_3"});
db.mymongo1_col2.insert({"_col1" : "3"}, {"_col2" : "col2_3", "_col3" :
"col3_3"});
db.mymongo1_col2.insert({"_col1" : "3"}, {"_col2" : "col2_3", "_col3" :
"col3_4"});
db.mymongo1_col2.find();
{ "_id" : ObjectId("5c0734a434943268d8387edf"), "_col1" : "3" }{ "_id" : ObjectId("5c0734a434943268d8387ee0"), "_col1" : "3" }
{ "_id" : ObjectId("5c0736fa34943268d8387ee1"), "_col1" : "3" }
case 3:
db.mymongo1_col3.insert({"_col1" : "3"}, "fld2": {"_col2" : "col2_3",
"_col3" : "col3_3"});
db.mymongo1_col3.insert({"_col1" : "3"}, "fld2": {"_col2" : "col2_3",
"_col3" : "col3_3"});
2018-12-04T21:22:51.497-0500 E QUERY [thread1] SyntaxError: missing )
after argument list @(shell):1:47
db.mymongo1_col3.insert({"_col1" : "3"}, "fld2": {"_col2" : "col2_3",
"_col3" : "col3_3"}});
db.mymongo1_col3.insert({"_col1" : "3"}, "fld2": {"_col2" : "col2_3",
"_col3" : "col3_3"}});
So some questions
Case 2 - why I don't see the embedded doc ? See the last on has "_col3" :
"col3_4"
Case 3 fails but Case 2 succeeded the only diff is prepending "fld2" from
what I can see. why ? However I think I see. see later case 3 in which i
start with two embeded docs vs case 5 am I right ?
db.mymongo1_col3.insert({"_col1" : "3"}, "fld2": {"_col2" : "col2_3",
"_col3" : "col3_3"});
db.mymongo1_col3.insert({"_col1" : "3"}, "fld2": {"_col2" : "col2_3",
"_col3" : "col3_4"});
Case 4
db.mymongo1_col4.insert( { _col1: "3" , size: { "_col2" : "col2_3", "_col3"
: "col3_3" }});
db.mymongo1_col4.insert( { _col1: "3", size: { "_col2" : "col2_3", "_col3"
: "col3_3" }});
db.mymongo1_col4.insert( { _col1: "3" , size: { "_col2" : "col2_3", "_col3"
: "col3_4"}});
db.mymongo1_col4.find();
{ "_id" : ObjectId("5c073bb834943268d8387ef9"), "_col1" : "3", "size" : {"_col2" : "col2_3", "_col3" : "col3_3" } }
{ "_id" : ObjectId("5c073bb834943268d8387efa"), "_col1" : "3", "size" : {
"_col2" : "col2_3", "_col3" : "col3_3" } }
{ "_id" : ObjectId("5c073bb834943268d8387efb"), "_col1" : "3", "size" : {
"_col2" : "col2_3", "_col3" : "col3_4" } }
Case 5
db.mymongo1_col5.insert( { _col1: "3" , "fld2": { "_col2" : "col2_3",
"_col3" : "col3_3" }});
db.mymongo1_col5.insert( { _col1: "3", "fld2": { "_col2" : "col2_3",
"_col3" : "col3_3" }});
db.mymongo1_col5.insert( { _col1: "3", "fld2": { "_col2" : "col2_3",
"_col3" : "col3_4" }});
db.mymongo1_col5.find();
{ "_id" : ObjectId("5c073bf034943268d8387efc"), "_col1" : "3", "fld2" : {"_col2" : "col2_3", "_col3" : "col3_3" } }
{ "_id" : ObjectId("5c073bf034943268d8387efd"), "_col1" : "3", "fld2" : {
"_col2" : "col2_3", "_col3" : "col3_3" } }
{ "_id" : ObjectId("5c073bf034943268d8387efe"), "_col1" : "3", "fld2" : {
"_col2" : "col2_3", "_col3" : "col3_4" } }
--
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.
For other MongoDB technical support options, see: https://docs.mongodb.com/manual/support/
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user+***@googlegroups.com.
To post to this group, send email to mongodb-***@googlegroups.com.
Visit this group at https://groups.google.com/group/mongodb-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/CAKrrPpiOTxxQmrOrfKULwi0o%2BcUg7aAKcPU08LOWZ6K%2BZMdA8g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.