Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MongoDB/DocumentDB bson_append_array(): invalid array detected. first element of array parameter is not "0"

Recently I have migrated one of my projects (PHP 7.4/Lumen/Ubuntu 20.04) from MongoDB to MongoDB compatible AWS DocumentDB. Since the migration all the CLI Scripts are triggering this strange notice/warning

bson_append_array(): invalid array detected. first element of array parameter is not "0".

enter image description here

Everything seems to be functionally working apart from this message (Even though I have all the PHP errors hidden from ini file this still shows up). Not really sure what is going on.

Message is actually coming from "find" method. I also did try to suppress the msg but no luck.

Does anyone have any idea what is going on here ? Appreciate and thanks for all your responses in advance.

  • DocumentDB version 4.0
  • PHP SDK Composer version 1.9.0
like image 961
M_R_K Avatar asked Oct 22 '25 10:10

M_R_K


1 Answers

If you add &authMechanism=SCRAM-SHA-1 to the connexion string, the warning disepear.

like image 99
Jérôme Lepeltier Avatar answered Oct 24 '25 23:10

Jérôme Lepeltier