Auth0 Home Blog Docs

can I use ToObject() to create a Rule?



I need to save data of the user actually I can save the object but the Json is very weird with fields like this:

 "age_range": {
      "$t": 3,
      "$v": {
        "min": {
          "$t": 16,
          "$v": 21

I read maybe is because I need to transform to Object the user to save it in my database but I get this error when I use it
for example:
var obj=user.toObject();
user.toObject is not a function
maybe is not supported.
Someone knows how to solve this problem?
Thank you!


The underlying issue for what you’re experiencing is likely related to how you communicate with the database, as mentioned in the answer to your other question. I’ll be closing this one as duplicate so the situation can be tackled in a single place.