juicycleff / ultimate-backend

Multi tenant SaaS starter kit with cqrs graphql microservice architecture, apollo federation, event source and authentication
https://juicycleff.github.io/ultimate-backend-docs
MIT License
2.61k stars 408 forks source link

mongodb $set operator added to repo-orm #150

Closed suadik closed 3 years ago

suadik commented 3 years ago

when using any of the mongodb update functions in the repo-orm to update a document, this exception is thrown. Error: the updateOne operation document must contain atomic operators, so I added the $set operator to the functions appropriately.

cemeheeb commented 3 years ago

This PR is fail when running on macOS

{
    "errors": [
        {
            "message": "52 undefined: The dollar ($) prefixed field '$set' in '$set' is not valid for storage.",
            "locations": [
                {
                    "line": 3,
                    "column": 5
                }
            ],
            "path": [
                "account",
                "register"
            ],
            "extensions": {
                "code": "INTERNAL_SERVER_ERROR",
                "exception": {
                    "code": 52,
                    "metadata": {
                        "_internal_repr": {},
                        "flags": 0
                    },
                    "details": "The dollar ($) prefixed field '$set' in '$set' is not valid for storage.",
                    "stacktrace": [
                        "Error: 52 undefined: The dollar ($) prefixed field '$set' in '$set' is not valid for storage.",
                        "    at Object.exports.createStatusError (/Users/ekpa-semeneev/Projects/zakazmix.repository/EKPA/node_modules/grpc/src/common.js:91:15)",
                        "    at Object.onReceiveStatus (/Users/ekpa-semeneev/Projects/zakazmix.repository/EKPA/node_modules/grpc/src/client_interceptors.js:1209:28)",
                        "    at InterceptingListener._callNext (/Users/ekpa-semeneev/Projects/zakazmix.repository/EKPA/node_modules/grpc/src/client_interceptors.js:568:42)",
                        "    at InterceptingListener.onReceiveStatus (/Users/ekpa-semeneev/Projects/zakazmix.repository/EKPA/node_modules/grpc/src/client_interceptors.js:618:8)",
                        "    at callback (/Users/ekpa-semeneev/Projects/zakazmix.repository/EKPA/node_modules/grpc/src/client_interceptors.js:847:24)"
                    ]
                }
            }
        }
    ],
    "data": {
        "account": null
    }
}