How to use the realm.Collection 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 / list-tests.js View on Github external
realm.write(() => {
            let obj = realm.create('PersonList', {list: []});
            TestCase.assertInstanceOf(obj.list, Realm.List);
            TestCase.assertInstanceOf(obj.list, Realm.Collection);
        });
github realm / realm-js / tests / js / results-tests.js View on Github external
testResultsConstructor: function() {
        var realm = new Realm({schema: [schemas.TestObject]});
        var objects = realm.objects('TestObject');

        TestCase.assertTrue(objects instanceof Realm.Results);
        TestCase.assertTrue(objects instanceof Realm.Collection);

        TestCase.assertThrows(function() {
            new Realm.Results();
        });

        TestCase.assertEqual(typeof Realm.Results, 'function');
        TestCase.assertTrue(Realm.Results instanceof Function);
    },