07 January 2022

MongoDB JSON to PHP array

Search and replace in Visual Studio Code.

Search for

\{\n.*\$oid.*"(.*)"\n.*\}
Replace with
new MongoDB\BSON\ObjectId("$1")
Search for
\{\n.*numberDouble.*"(.*)"\n.*\}
Replace with
$1
Search for
\{\n.*numberInt.*"(.*)"\n.*\}
Replace with
$1

No comments:

Post a Comment