CRUD || aggregation

why there is not a json parser comand :sob: :sob: :sob: :sob: :sob: :sob: :sob: :sob: :sob: :sob: :sob: :sob: :sob: :sob: :sob: :sob: :sob: :sob: :sob: :sob: :sob: :sob: :sob: :sob: :sob: :sob: :sob: :sob: :sob: :sob: :sob: :triumph: :triumph: :triumph: :triumph:

Like this?

1 Like

thanks for your reply, you proposed a schema validation witch won’t work in my case, my situation is as follows:
I imported a csv file, with fields having a subdocument as value, some of them were parsed as an object and some are still in string format β€œ[{” k β€œ:” v ". …}] "
to transform untransformed values a used the following code
e.field = JSON.parse(e.filed)
db.col.update({e._id},{$set:{field: e.field, version:1}})
db.col.update({e._id},{$set:{ version:0}})
that is a working solution but with high latency, I need to retrieve the document transform them on the client then update them to the database,
but if there where an aggregation command like for example $stringToObject, that would’ve been more optimal

You may use firefox to open a .json file.

:face_with_monocle: :butterfly:

Hi @Ali_Ouahhabi,

We have a great community forum where you can have an in-depth conversation about specific use cases and interesting problems that you get to solve using MongoDB.If you still have any doubts, I would highly recommend posting your question there for a more involved discussion.