realm-js icon indicating copy to clipboard operation
realm-js copied to clipboard

Ability to configure location of `mongodb-realm` directory generated by Node/React Native SDKs

Open mongodben opened this issue 2 years ago • 3 comments

Problem

Developers using the SDK cannot configure the location of the mongodb-realm directory generated by the SDK when using Atlas App Services functionality (including Device Sync).

The generated location of the mongodb-realm directory causes issues when building applications with Electron. see this forum thread for a community user-reported error. and see this application i build a couple months back for a example of the error in a full application.

I'm not sure if there are other scenarios that require or would benefit from this solution, but i could imagine that there are.

Solution

Add an additional AppConfiguration property for specifying the path for the mongodb-realm directory.

For example:

AppConfiguration.mongodbRealmFilePath = 'my/custom/path';

Note: the .NET Realm SDK already has a similar implementation of this functionality with BaseFilePath.

How important is this improvement for you?

Would be a major improvement

mongodben avatar Jul 08 '22 18:07 mongodben

Thanks @mongodben. I'll get discuss this with the team and get this added to our backlog.

takameyer avatar Jul 11 '22 10:07 takameyer

@takameyer @bmunkholm do we have a workaround to this yet? I am running into the same errors while packaging an electron app. I configured the sync options but when doing Realm.App it force the creation of the mongodb-realm folder.

alejandro avatar Jun 23 '23 03:06 alejandro

@alejandro It's been available since v11.6.0 through the baseFilePath config.

takameyer avatar Jun 23 '23 06:06 takameyer