How to use the realm.exists function in realm

To help you get started, we’ve selected a few realm examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github realm / realm-js / tests / js / realm-tests.js View on Github external
testRealmExists: function() {

        // Local Realms
        let config = {schema: [schemas.TestObject]};
        TestCase.assertFalse(Realm.exists(config));
        new Realm(config).close();
        TestCase.assertTrue(Realm.exists(config));

        // Sync Realms
        if (!global.enableSyncTests) {
            return;
        }
        return Realm.Sync.User.login('http://127.0.0.1:9080', Realm.Sync.Credentials.nickname("admin", true))
            .then(user => {
                const fullSyncConfig = user.createConfiguration({
                    schema: [schemas.TestObject],
                    sync: {
                        url: `realm://127.0.0.1:9080/testRealmExists_${Utils.uuid()}`,
                        fullSynchronization: true,
                    },
                });
                TestCase.assertFalse(Realm.exists(fullSyncConfig));
                new Realm(fullSyncConfig).close();
github realm / realm-js / tests / js / realm-tests.js View on Github external
testRealmExists: function() {

        // Local Realms
        let config = {schema: [schemas.TestObject]};
        TestCase.assertFalse(Realm.exists(config));
        new Realm(config).close();
        TestCase.assertTrue(Realm.exists(config));

        // Sync Realms
        if (!global.enableSyncTests) {
            return;
        }
        return Realm.Sync.User.login('http://127.0.0.1:9080', Realm.Sync.Credentials.nickname("admin", true))
            .then(user => {
                const fullSyncConfig = user.createConfiguration({
                    schema: [schemas.TestObject],
                    sync: {
                        url: `realm://127.0.0.1:9080/testRealmExists_${Utils.uuid()}`,
                        fullSynchronization: true,
                    },
                });
github realm / realm-js / tests / js / open-behavior-tests.js View on Github external
.then(user => {
                let config = user.createConfiguration({
                    sync: {
                        url: 'http://127.0.0.1/new_file_local_' + Utils.uuid(),
                        newRealmFileBehavior: Realm.Sync.openLocalRealmBehavior,
                        error: () => {},
                    }
                });
                TestCase.assertFalse(Realm.exists(config));
                return Realm.open(config);
            })
            .then(realm => {
github realm / realm-js / tests / js / realm-tests.js View on Github external
fullSynchronization: true,
                    },
                });
                TestCase.assertFalse(Realm.exists(fullSyncConfig));
                new Realm(fullSyncConfig).close();
                TestCase.assertTrue(Realm.exists(fullSyncConfig));

                const queryBasedConfig = user.createConfiguration({
                    schema: [schemas.TestObject],
                    sync: {
                        url: `realm://127.0.0.1:9080/testRealmExists_${Utils.uuid()}`,
                    },
                });
                TestCase.assertFalse(Realm.exists(queryBasedConfig));
                new Realm(queryBasedConfig).close();
                TestCase.assertTrue(Realm.exists(queryBasedConfig));
            });
    },
github realm / realm-js / tests / js / realm-tests.js View on Github external
sync: {
                        url: `realm://127.0.0.1:9080/testRealmExists_${Utils.uuid()}`,
                        fullSynchronization: true,
                    },
                });
                TestCase.assertFalse(Realm.exists(fullSyncConfig));
                new Realm(fullSyncConfig).close();
                TestCase.assertTrue(Realm.exists(fullSyncConfig));

                const queryBasedConfig = user.createConfiguration({
                    schema: [schemas.TestObject],
                    sync: {
                        url: `realm://127.0.0.1:9080/testRealmExists_${Utils.uuid()}`,
                    },
                });
                TestCase.assertFalse(Realm.exists(queryBasedConfig));
                new Realm(queryBasedConfig).close();
                TestCase.assertTrue(Realm.exists(queryBasedConfig));
            });
    },
github realm / realm-js / tests / js / realm-tests.js View on Github external
.then(user => {
                const fullSyncConfig = user.createConfiguration({
                    schema: [schemas.TestObject],
                    sync: {
                        url: `realm://127.0.0.1:9080/testRealmExists_${Utils.uuid()}`,
                        fullSynchronization: true,
                    },
                });
                TestCase.assertFalse(Realm.exists(fullSyncConfig));
                new Realm(fullSyncConfig).close();
                TestCase.assertTrue(Realm.exists(fullSyncConfig));

                const queryBasedConfig = user.createConfiguration({
                    schema: [schemas.TestObject],
                    sync: {
                        url: `realm://127.0.0.1:9080/testRealmExists_${Utils.uuid()}`,
                    },
                });
                TestCase.assertFalse(Realm.exists(queryBasedConfig));
                new Realm(queryBasedConfig).close();
                TestCase.assertTrue(Realm.exists(queryBasedConfig));
            });
    },
github realm / realm-js / tests / js / realm-tests.js View on Github external
.then(user => {
                const fullSyncConfig = user.createConfiguration({
                    schema: [schemas.TestObject],
                    sync: {
                        url: `realm://127.0.0.1:9080/testRealmExists_${Utils.uuid()}`,
                        fullSynchronization: true,
                    },
                });
                TestCase.assertFalse(Realm.exists(fullSyncConfig));
                new Realm(fullSyncConfig).close();
                TestCase.assertTrue(Realm.exists(fullSyncConfig));

                const queryBasedConfig = user.createConfiguration({
                    schema: [schemas.TestObject],
                    sync: {
                        url: `realm://127.0.0.1:9080/testRealmExists_${Utils.uuid()}`,
                    },
                });
                TestCase.assertFalse(Realm.exists(queryBasedConfig));
                new Realm(queryBasedConfig).close();
                TestCase.assertTrue(Realm.exists(queryBasedConfig));
            });
    },