Dot notation in MongoDB InsertOneMongoDB or CouchDB - fit for production?When to use MongoDB or other document oriented database systems?MongoDB vs. CassandraHow to query MongoDB with “like”?Delete everything in a MongoDB databaseMongoDB relationships: embed or reference?When to Redis? When to MongoDB?How do I drop a MongoDB database from the command line?Pretty print in MongoDB shell as defaultWhen to use CouchDB over MongoDB and vice versa

Installing PowerShell on 32-bit Kali OS fails

Can somebody explain Brexit in a few child-proof sentences?

Can I create an upright 7-foot × 5-foot wall with the Minor Illusion spell?

How to prevent YouTube from showing already watched videos?

How can I raise concerns with a new DM about XP splitting?

Did US corporations pay demonstrators in the German demonstrations against article 13?

Science Fiction story where a man invents a machine that can help him watch history unfold

Pronouncing Homer as in modern Greek

What (else) happened July 1st 1858 in London?

Books on the History of math research at European universities

Is exact Kanji stroke length important?

Is there any significance to the Valyrian Stone vault door of Qarth?

Why are all the doors on Ferenginar (the Ferengi home world) far shorter than the average Ferengi?

Can the harmonic series explain the origin of the major scale?

Lifted its hind leg on or lifted its hind leg towards?

Can a Bard use an arcane focus?

Are taller landing gear bad for aircraft, particulary large airliners?

Freedom of speech and where it applies

Is there a problem with hiding "forgot password" until it's needed?

What do you call the infoboxes with text and sometimes images on the side of a page we find in textbooks?

Why is delta-v is the most useful quantity for planning space travel?

Is it okay / does it make sense for another player to join a running game of Munchkin?

Why does this part of the Space Shuttle launch pad seem to be floating in air?

How will losing mobility of one hand affect my career as a programmer?



Dot notation in MongoDB InsertOne


MongoDB or CouchDB - fit for production?When to use MongoDB or other document oriented database systems?MongoDB vs. CassandraHow to query MongoDB with “like”?Delete everything in a MongoDB databaseMongoDB relationships: embed or reference?When to Redis? When to MongoDB?How do I drop a MongoDB database from the command line?Pretty print in MongoDB shell as defaultWhen to use CouchDB over MongoDB and vice versa













0















While performing InsertOne in MongoDB (4.0.5) from PHP I get the following exception:



[0] Detected unsupported PHP type for field path "context.trace.1.args.2": 7



According to the MongoDB documentation one is allowed to use dot notation in update commands. The doc however talks about this fact with $set as context.



It seems to me that a simple Update does not allow for dot notation. (just guessing)



Can someone explain the nuance/edge cases here?



===== follow up on request:



The document is created by Monolog.
And the document used in InsertOne looks like the following:



Array
(
[message] => file_get_contents( ...obfuscated... ): failed to open stream: Connection timed out
[context] => Array
(
[code] => 2
[file] => ...obfuscated...
[line] => 127
[trace] => Array
(
[0] => Array
(
[function] => handleError
[class] => WhoopsRun
[type] => ->
...obfuscated...
)

[1] => Array
(
[function] => file_get_contents
[args] => Array
(
[0] => https:// ...obfuscated...
[1] =>
[2] => 0
)

)

[2] => Array
(
[file] => ...obfuscated... .php
[line] => 127
[function] => file_get_contents
[args] => Array
(
[0] => https:// ...obfuscated...
)

)

[3] => Array
(
[file] => ...obfuscated... .php
[line] => 91
[args] => Array
(
[0] => ...obfuscated... .php
)

[function] => require_once
)

)

[notThrown] => 1
[type] => WhoopsExceptionErrorException
)

[level] => 500
[level_name] => CRITICAL
[channel] => ...obfuscated...
[datetime] => MongoDBBSONUTCDateTime Object
(
[milliseconds] => 1551951362000
)

[extra] => Array
(
[cli] => Array
(
[user] => ...obfuscated...
[script] => ...obfuscated... .php
[argv] => Array
(
[0] => ...obfuscated...
)

)

[server_name] => ...obfuscated...
[server_ip] => ...obfuscated...
[process_id] => 3273
[memory_peak_usage] => 5.75 MB
[memory_usage] => 5.75 MB
[git] => Array
(
[ ...obfuscated... ] => Array
(
[branch] => ...obfuscated...
[commit] => ...obfuscated...
)

[publisher] => Array
(
[branch] => ...obfuscated...
[commit] => ...obfuscated...
)

)

)

[server_name] => ...obfuscated...
[_id] => MongoDBBSONObjectId Object
(
[oid] => 5c81e6029caba40cc96bd831
)

)


I suspect Neil Lunn already answers the question.



But now I wonder whether this is a shortcoming of Monolog or not. And what approach to take to solve this issue.










share|improve this question
























  • Please show the query you're trying to execute.

    – deceze
    Mar 7 at 10:19






  • 1





    From the use of index positions in that path I presume you are attempting to "push" into an array. insertOne() actually "creates documents", and hence you cannot use a "dotted path name".

    – Neil Lunn
    Mar 7 at 10:27











  • @deceze I've follewed up on your request

    – Bart Gloudemans
    Mar 7 at 11:38















0















While performing InsertOne in MongoDB (4.0.5) from PHP I get the following exception:



[0] Detected unsupported PHP type for field path "context.trace.1.args.2": 7



According to the MongoDB documentation one is allowed to use dot notation in update commands. The doc however talks about this fact with $set as context.



It seems to me that a simple Update does not allow for dot notation. (just guessing)



Can someone explain the nuance/edge cases here?



===== follow up on request:



The document is created by Monolog.
And the document used in InsertOne looks like the following:



Array
(
[message] => file_get_contents( ...obfuscated... ): failed to open stream: Connection timed out
[context] => Array
(
[code] => 2
[file] => ...obfuscated...
[line] => 127
[trace] => Array
(
[0] => Array
(
[function] => handleError
[class] => WhoopsRun
[type] => ->
...obfuscated...
)

[1] => Array
(
[function] => file_get_contents
[args] => Array
(
[0] => https:// ...obfuscated...
[1] =>
[2] => 0
)

)

[2] => Array
(
[file] => ...obfuscated... .php
[line] => 127
[function] => file_get_contents
[args] => Array
(
[0] => https:// ...obfuscated...
)

)

[3] => Array
(
[file] => ...obfuscated... .php
[line] => 91
[args] => Array
(
[0] => ...obfuscated... .php
)

[function] => require_once
)

)

[notThrown] => 1
[type] => WhoopsExceptionErrorException
)

[level] => 500
[level_name] => CRITICAL
[channel] => ...obfuscated...
[datetime] => MongoDBBSONUTCDateTime Object
(
[milliseconds] => 1551951362000
)

[extra] => Array
(
[cli] => Array
(
[user] => ...obfuscated...
[script] => ...obfuscated... .php
[argv] => Array
(
[0] => ...obfuscated...
)

)

[server_name] => ...obfuscated...
[server_ip] => ...obfuscated...
[process_id] => 3273
[memory_peak_usage] => 5.75 MB
[memory_usage] => 5.75 MB
[git] => Array
(
[ ...obfuscated... ] => Array
(
[branch] => ...obfuscated...
[commit] => ...obfuscated...
)

[publisher] => Array
(
[branch] => ...obfuscated...
[commit] => ...obfuscated...
)

)

)

[server_name] => ...obfuscated...
[_id] => MongoDBBSONObjectId Object
(
[oid] => 5c81e6029caba40cc96bd831
)

)


I suspect Neil Lunn already answers the question.



But now I wonder whether this is a shortcoming of Monolog or not. And what approach to take to solve this issue.










share|improve this question
























  • Please show the query you're trying to execute.

    – deceze
    Mar 7 at 10:19






  • 1





    From the use of index positions in that path I presume you are attempting to "push" into an array. insertOne() actually "creates documents", and hence you cannot use a "dotted path name".

    – Neil Lunn
    Mar 7 at 10:27











  • @deceze I've follewed up on your request

    – Bart Gloudemans
    Mar 7 at 11:38













0












0








0








While performing InsertOne in MongoDB (4.0.5) from PHP I get the following exception:



[0] Detected unsupported PHP type for field path "context.trace.1.args.2": 7



According to the MongoDB documentation one is allowed to use dot notation in update commands. The doc however talks about this fact with $set as context.



It seems to me that a simple Update does not allow for dot notation. (just guessing)



Can someone explain the nuance/edge cases here?



===== follow up on request:



The document is created by Monolog.
And the document used in InsertOne looks like the following:



Array
(
[message] => file_get_contents( ...obfuscated... ): failed to open stream: Connection timed out
[context] => Array
(
[code] => 2
[file] => ...obfuscated...
[line] => 127
[trace] => Array
(
[0] => Array
(
[function] => handleError
[class] => WhoopsRun
[type] => ->
...obfuscated...
)

[1] => Array
(
[function] => file_get_contents
[args] => Array
(
[0] => https:// ...obfuscated...
[1] =>
[2] => 0
)

)

[2] => Array
(
[file] => ...obfuscated... .php
[line] => 127
[function] => file_get_contents
[args] => Array
(
[0] => https:// ...obfuscated...
)

)

[3] => Array
(
[file] => ...obfuscated... .php
[line] => 91
[args] => Array
(
[0] => ...obfuscated... .php
)

[function] => require_once
)

)

[notThrown] => 1
[type] => WhoopsExceptionErrorException
)

[level] => 500
[level_name] => CRITICAL
[channel] => ...obfuscated...
[datetime] => MongoDBBSONUTCDateTime Object
(
[milliseconds] => 1551951362000
)

[extra] => Array
(
[cli] => Array
(
[user] => ...obfuscated...
[script] => ...obfuscated... .php
[argv] => Array
(
[0] => ...obfuscated...
)

)

[server_name] => ...obfuscated...
[server_ip] => ...obfuscated...
[process_id] => 3273
[memory_peak_usage] => 5.75 MB
[memory_usage] => 5.75 MB
[git] => Array
(
[ ...obfuscated... ] => Array
(
[branch] => ...obfuscated...
[commit] => ...obfuscated...
)

[publisher] => Array
(
[branch] => ...obfuscated...
[commit] => ...obfuscated...
)

)

)

[server_name] => ...obfuscated...
[_id] => MongoDBBSONObjectId Object
(
[oid] => 5c81e6029caba40cc96bd831
)

)


I suspect Neil Lunn already answers the question.



But now I wonder whether this is a shortcoming of Monolog or not. And what approach to take to solve this issue.










share|improve this question
















While performing InsertOne in MongoDB (4.0.5) from PHP I get the following exception:



[0] Detected unsupported PHP type for field path "context.trace.1.args.2": 7



According to the MongoDB documentation one is allowed to use dot notation in update commands. The doc however talks about this fact with $set as context.



It seems to me that a simple Update does not allow for dot notation. (just guessing)



Can someone explain the nuance/edge cases here?



===== follow up on request:



The document is created by Monolog.
And the document used in InsertOne looks like the following:



Array
(
[message] => file_get_contents( ...obfuscated... ): failed to open stream: Connection timed out
[context] => Array
(
[code] => 2
[file] => ...obfuscated...
[line] => 127
[trace] => Array
(
[0] => Array
(
[function] => handleError
[class] => WhoopsRun
[type] => ->
...obfuscated...
)

[1] => Array
(
[function] => file_get_contents
[args] => Array
(
[0] => https:// ...obfuscated...
[1] =>
[2] => 0
)

)

[2] => Array
(
[file] => ...obfuscated... .php
[line] => 127
[function] => file_get_contents
[args] => Array
(
[0] => https:// ...obfuscated...
)

)

[3] => Array
(
[file] => ...obfuscated... .php
[line] => 91
[args] => Array
(
[0] => ...obfuscated... .php
)

[function] => require_once
)

)

[notThrown] => 1
[type] => WhoopsExceptionErrorException
)

[level] => 500
[level_name] => CRITICAL
[channel] => ...obfuscated...
[datetime] => MongoDBBSONUTCDateTime Object
(
[milliseconds] => 1551951362000
)

[extra] => Array
(
[cli] => Array
(
[user] => ...obfuscated...
[script] => ...obfuscated... .php
[argv] => Array
(
[0] => ...obfuscated...
)

)

[server_name] => ...obfuscated...
[server_ip] => ...obfuscated...
[process_id] => 3273
[memory_peak_usage] => 5.75 MB
[memory_usage] => 5.75 MB
[git] => Array
(
[ ...obfuscated... ] => Array
(
[branch] => ...obfuscated...
[commit] => ...obfuscated...
)

[publisher] => Array
(
[branch] => ...obfuscated...
[commit] => ...obfuscated...
)

)

)

[server_name] => ...obfuscated...
[_id] => MongoDBBSONObjectId Object
(
[oid] => 5c81e6029caba40cc96bd831
)

)


I suspect Neil Lunn already answers the question.



But now I wonder whether this is a shortcoming of Monolog or not. And what approach to take to solve this issue.







mongodb insert mongodb4.0






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 7 at 11:37







Bart Gloudemans

















asked Mar 7 at 10:16









Bart GloudemansBart Gloudemans

661524




661524












  • Please show the query you're trying to execute.

    – deceze
    Mar 7 at 10:19






  • 1





    From the use of index positions in that path I presume you are attempting to "push" into an array. insertOne() actually "creates documents", and hence you cannot use a "dotted path name".

    – Neil Lunn
    Mar 7 at 10:27











  • @deceze I've follewed up on your request

    – Bart Gloudemans
    Mar 7 at 11:38

















  • Please show the query you're trying to execute.

    – deceze
    Mar 7 at 10:19






  • 1





    From the use of index positions in that path I presume you are attempting to "push" into an array. insertOne() actually "creates documents", and hence you cannot use a "dotted path name".

    – Neil Lunn
    Mar 7 at 10:27











  • @deceze I've follewed up on your request

    – Bart Gloudemans
    Mar 7 at 11:38
















Please show the query you're trying to execute.

– deceze
Mar 7 at 10:19





Please show the query you're trying to execute.

– deceze
Mar 7 at 10:19




1




1





From the use of index positions in that path I presume you are attempting to "push" into an array. insertOne() actually "creates documents", and hence you cannot use a "dotted path name".

– Neil Lunn
Mar 7 at 10:27





From the use of index positions in that path I presume you are attempting to "push" into an array. insertOne() actually "creates documents", and hence you cannot use a "dotted path name".

– Neil Lunn
Mar 7 at 10:27













@deceze I've follewed up on your request

– Bart Gloudemans
Mar 7 at 11:38





@deceze I've follewed up on your request

– Bart Gloudemans
Mar 7 at 11:38












0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55041263%2fdot-notation-in-mongodb-insertone%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55041263%2fdot-notation-in-mongodb-insertone%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Save data to MySQL database using ExtJS and PHP [closed]2019 Community Moderator ElectionHow can I prevent SQL injection in PHP?Which MySQL data type to use for storing boolean valuesPHP: Delete an element from an arrayHow do I connect to a MySQL Database in Python?Should I use the datetime or timestamp data type in MySQL?How to get a list of MySQL user accountsHow Do You Parse and Process HTML/XML in PHP?Reference — What does this symbol mean in PHP?How does PHP 'foreach' actually work?Why shouldn't I use mysql_* functions in PHP?

Compiling GNU Global with universal-ctags support Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!Tags for Emacs: Relationship between etags, ebrowse, cscope, GNU Global and exuberant ctagsVim and Ctags tips and trickscscope or ctags why choose one over the other?scons and ctagsctags cannot open option file “.ctags”Adding tag scopes in universal-ctagsShould I use Universal-ctags?Universal ctags on WindowsHow do I install GNU Global with universal ctags support using Homebrew?Universal ctags with emacsHow to highlight ctags generated by Universal Ctags in Vim?

Add ONERROR event to image from jsp tldHow to add an image to a JPanel?Saving image from PHP URLHTML img scalingCheck if an image is loaded (no errors) with jQueryHow to force an <img> to take up width, even if the image is not loadedHow do I populate hidden form field with a value set in Spring ControllerStyling Raw elements Generated from JSP tagds with Jquery MobileLimit resizing of images with explicitly set width and height attributeserror TLD use in a jsp fileJsp tld files cannot be resolved