I have google cloud function with mongo node js sdk where I call realm function to get the data.
During function execution sdk tries to create Mongodb-realm folder and some files there for sync purposes (why it was done in this way? I do not want it happen at all, for me it looks like security issue
)
Error: Unable to open a realm at path '/workspace/mongodb-realm/products-gjstr/server-utility/metadata/sync_metadata.realm.lock'. Please use a path where your app has read-write permissions.
As I understood it’s not possible to prevent this folder being created. I need somehow give permissions for function to create this folder. Can not find how to do it. Any recommendations?
Also is it possible to call the realm function via http? I just need to get the data and I do not care about sync sdk capabilities and so on
The SDK is supposed to work with clients (especially mobile), not from a backend function, and it keeps a local copy of the DB to enable the offline functionality.
You can try to use the Realm Web SDK, that doesn’t, at this time, support the offline functionality, and allows you to call functions.
Yes, it is: you must of course do what the SDK does behind the scenes first:
Determine the location of your app: https://realm.mongodb.com/api/client/v2.0/app/<app-id>/location: this will return the hostname you should use for the next queries