Menu
  • HOME
  • TAGS

Getting child RLMObjects from transformer using ObjectMapper

swift,realm,object-object-mapping

So this seems to be the solution how to convert an array of children to my RLMObject Attachment. I'd love some feedback on how wrong I am implementing this and what would be a more proper solution since I feel kinda bad for this: ///Transformer transforming the api's attachment array...

Realm - array of NSString as property?

realm

Joe from Realm here. Currently we don't support Arrays of primitive types. It is something that we are discussing and on the road map though. For now your best bet will be to create another RLMObject and then an RLMArray relationship to that, to store your primitive types....

How to reproduce MATCHES in NSPredicate to query Realm?

regex,nspredicate,realm

So for now I have solved the problem like this (modifying the model, which I wanted to avoid): I store only the path to the parent, not the full one along with the name. The name gets stored in a different field (to get full path I stitch the two...

Unable to use both Swift and Obj-C libs with Cocoapods

ios,objective-c,swift,cocoapods,realm

Alright, here is the full walkthrough: Install dependencies using Cocoapods and the use_frameworks! flag. As you need to use a Objective-C dependency, create a Bridging header. You can create one easily by importing an Objective-C class to your Swift project, than remove it (the wizard should ask you if need...

Can I store objects from android SDK like Location?

android,realm

Realm can only store classes that extends RealmObject, so it is not possible to save the android.location.Location class directly. If you require the android Location class for some other API I would create my own Realm Location class that are able to convert it's representation, like so: public class MyLocation...

Realm error: Invalid Value, expecting int and receiving: 0

ios,swift,realm

try this: let idQuery = realm.objects(JournalEntryLine).filter("id = \(item) AND type = 'Debit'") transform id = '\(item)' to id = \(item) because id is an Integer, if you use quotes, il will consider id as a string....

Encryption in Realm gives java.lang.IllegalStateException: Wrong key used to decrypt Realm

android,encryption,realm

The encryption key is used to encrypt/decrypt the actual file. So it has to be same across all transactions. That is also why you need to find a way to save the key between app restarts as otherwise you cannot access the Realm again. There are some links in our...

Realm.IO - Can JSON array be parsed using createOrUpdateAllFromJson?

android,json,realm

Yes, Realm should be able to parse that, but it looks like your naming is not right. Your Doctor class calls it specializationList but in your JSON it is specializations. If you change your Doctor class to the following it should work: public class Doctor extends RealmObject { @PrimaryKey private...

Retrofit and Realm access from another thread in Android

android,multithreading,retrofit,realm

Yeah Disabilities extends RealmObject and is part of the Realm. What you could do is create a new object: Disabilities disabilities = new Disabilities(); And then put the content that's inside the Disabilities in your new object. This works because this object is not in Realm yet....

Adding items to Realm database changes some variables

android,database,list,realm,realm-list

SearchData class has both getIs_favorite() and is_favorite(). In that case, Realm annotation processor overrides only is_favorite(). That's why getIs_favorite() returns always false....

authc filter is not calling MyRealm in shiro with spring

java,spring,security,shiro,realm

My problem was to add /login.html = authc to url, for others like me who searched for this one line for 3 days.

Is possible to save Realm documentation for offline reading?

android,ios,documentation,realm

If you look at the top of the webpage that you linked it says: Install in Dash. Dash is an app in App Store: https://itunes.apple.com/ro/app/dash-api-docs-snippets/id458034879?mt=12 that let's you view documentation offline....

Realm swift creates objective c files

objective-c,swift,realm

Don't use the create new model from the Xcode new file. Create instead a Swift file and write the Realm object yourself. This is how a Realm object looks like in Swift: import RealmSwift // Dog model class Dog: Object { dynamic var name = "" dynamic var owner: Person?...

How to clone a object with primary key in Realm.io (objective-c)

ios,objective-c,realm

Create a new ActivityTreeModel object: [[ActivityTreeModel alloc] init], and then set all it's properties as to the one you want to copy, but with the different primary key.

Getting NullPointer adding object to RealmList

android,realm

You need to add the object to the realm before adding it to a list because internally Realm will call getId (or whatever method to get it's primary key) in order to add the object to the list. Since it uses proxy methods and the object was not added to...

Using Reflection with Realm (Android)

java,android,reflection,realm

Well I found a way, by doing something quite silly, any better options?: Class clazz = obj.getClass(); if (clazz.getName().endsWith("Proxy")) { clazz = clazz.getSuperclass(); } I'm 100% sure objects will never end with Proxy ;) in my app....

I have problems adding a RealmObject that contains a RealmList of LatLng

android,database,sqlite,realm

Create your own class (e.g. MyLatLng) which mimics LatLng structure. Next create static method inside your MyLatLng class which converts MyLatLng object to LatLng object and vice versa. It have to be static because only setters and getters are allowed methods in RealmObject classes.

Correct way to retrieve a single object from Realm database

database,swift,realm

objectForPrimaryKey() is what you're looking for: Realm().objectForPrimaryKey(Book.self, key: prevBook.nextID). There's no simpler way than filter().first if you need to search for the object by something other than the primary key.

Can I have arrayList of string in realm object android

java,android,arraylist,realm,realm-list

Yes, you have to manually box your strings in a StringObject. We'd like to add support for RealmList<String>, RealmList<Integer>, etc., but it's a long way out.

Realm `description` property behaving differently to other properties

ios,realm

By creating a description property, you're overriding the -description method on NSObject that's used to print an object's contents when using NSLog or println. See http://stackoverflow.com/a/4718806/373262 for more details....

adding and removing Realm.Object during a migration

swift,migration,realm

When you download the Realm, you have an Example project. Open it and you have a demo for migration. This is how they do the migration: let migrationBlock: MigrationBlock = { migration, oldSchemaVersion in if oldSchemaVersion < 1 { migration.enumerate(Person.className()) { oldObject, newObject in if oldSchemaVersion < 1 { //...

Realm database layer gives error under Eclipse, Genymotion emulator and devices

android,genymotion,eclipse-adt,realm

The answer is in this thread https://github.com/realm/realm-java/issues/705#issuecomment-77466953 Best regards....

Android Realm Retrofit relationship error

java,android,gson,retrofit,realm

On request the callback you're probably getting a List <WorkOrderItem> So I think you need to create your Realmlist <WorkOrderItem> from your list. you need have two Objects WorkOrderItem and other WorkOrderItemRealm extends RealmObject For instance : List<WorkOrderItem> mWorkOrderList... RealmList<WorkOrderItem> mRealmList... //WorkOrderItem need to be a RealmObject ...new Callback<List<WorkOrderItem> mWorkOrderList>()...

Using Realm with Swift on iOS 7

ios,swift,ios7,realm

Since RealmSwift must be distributed as a dynamic framework, there's no real way to use it on iOS 7. Realm Objective-C should work just fine in Swift, albeit with a less 'native' feel.

'Realm accessed from incorrect thread' error in prepareForSegue; Swift

ios,multithreading,swift,grand-central-dispatch,realm

I'm pretty sure the crash happens because you're trying to use an article from a "background accessed Realm" in the ReadArticleViewController's viewDidLoad method which is called in the main thread. You cannot access Realm from background to pick an article in your prepareForSegue: method and then use the article...

From SQL Foreign keys to Realm References?

json,realm

Hi Joe from Realm here. You are correct, you will need to pull down the JSON then build out your objects manually on the client side. Realm is object graph based so you link objects with objects directly! For example if a person has many dogs, on the server you...

Realm.io API mapping parent object automatically

swift,realm

I think you better use Inverse Relationships for ToOne relationship instead. Foo class will be the same. but you will change foo property in Bar class, like the following. class Bar: Object { dynamic var id = 0 dynamic var title = "" //dynamic var foo = Foo() // Reference...

Unable to invoke max with an argument list of type String

swift,realm

let nextId = realm.objects(Alarm).max("id") as Int? You need to tell Swift what the return type of max() should be at the call site because it varies depending on the type of the property that you name in the string parameter. It needs to be Int? rather than just Int because...

How to convert RealmResults object to RealmList?

android,realm

RealmList <Student> results = new RealmList<Student>(); for(Student student : realResultsList){ results.add(student); } However, this is not the most elegant way to do the conversion. ...

Objective-C Swift interoperability with Realm

ios,swift,realm

If you need Objective-C interop, your best bet is to continue using Realm Objective-c. Since List is a generic type, it can't be represented in ObjC at all.

Adding RealmSwift as a subproject: Missing required modules: 'Realm.Private', 'Realm'

ios,xcode,frameworks,realm

You'll need to add /path/to/RealmSwift.framework/Frameworks to the “Framework Search Paths” section in Build Settings where /path/to/RealmSwift.framework is the location of the framework. This is because RealmSwift.framework depends on Realm.framework (where the Realm and Realm.Private modules are defined), which is vendored in its Frameworks directory....

How can I fix this memory issue in my maximum matching algorithm with RealmSwift?

algorithm,swift,realm,text-segmentation

In this case, you should use autoreleasepool (see: Use Local Autorelease Pool Blocks to Reduce Peak Memory Footprint) in the loop: while position > 0 { autoreleasepool { var index = advance(string.startIndex, position) ... } } BTW, your code has too many memory copy operations and O(N) operations on String.Index...

Updating an object on realm

ios,realm

Try the following: var findConversations = ShufflePerson.objectsWhere("receiver='\(from)'") var shuf = findConversations[0] as! ShufflePerson self.realm.beginWriteTransaction() shuf.unreadMessage++ self.realm.commitWriteTransaction() The issue, as the exception message said, was that you were modifying the object outside of the write transaction. Doing that mutation inside the transaction should do the trick!...

What's the most efficient way to store time zone info in Realm?

ios,osx,nsdate,realm,foundation

Option 2 will use less space, but the difference may not be worth caring about in your case. With 5000 entries and Option 1 you'd be looking at 160KB of string data (for short strings, the storage size is rounded up to a power of two for O(1) indexing within...

Issue setting a RealmList to my database item, using Realm for android

android,database,web-services,gson,realm

Did it like this and it worked: WSCalls.getData("/api/users/" + user.getId() + "/friends", PSProfileActivity.this, loader, new JsonCallback() { @Override public void onResponse(JSONObject jsonObject) { try { FriendsResponse friendsResponse = JsonUtil.jsonToObject(jsonObject.toString(), FriendsResponse.class); Log.i("","friends response: " + friendsResponse.getFriends()); Realm realm = Realm.getInstance(PSProfileActivity.this); friends = friendsResponse.getFriends(); for (UserRecord friend : friends) {...

Assigning property to subclass of RLMObject

realm

That's a current limitation of Realm. It doesn't support polymorphism on relations. If possible, I'd avoid inheritance in this case. You could reach that by altering your object-relational mapping: You could add a further discriminator column to your Base class and have relations to classes which contain further attributes and...

findFirst method in Realm?

cocoa,realm

You can simplify that and just do: [myRlmObject allObjects].firstObject ...

Return unique/distinct values with Realm query

ios,objective-c,swift,realm

I found out that Realm doesn't fully support distinct queries yet. The good news is I also found a workaround for it, on this github issue. Objective-c RLMResults *messages = [Message allObjects]; NSMutableArray *uniqueIDs = [[NSMutableArray alloc] init]; NSMutableArray *uniqueMessages = [[NSMutableArray alloc] init]; for (Message *msg in messages) {...

Realm 0.92 with swift get object at index

ios,swift,realm

I believe you can just do it like this var RealmObject = RealmX[0] ...

RealmMigrationNeededException when changing Realm model

android,realm

You should be able to find the information you need here: https://realm.io/docs/java/latest/#migrations Just changing your code to the new definition will work fine, if you have no data stored on disk under the old database schema. But if you do, there will be a mismatch between what Realm sees defined...

Watchkit & Realm 0.92.3

ios,watchkit,realm

I would recommend you, that you use CocoaPods. I did it like you did, with dynamic frameworks. But when I try to submit my application (in Xcode/Organizer) to iTunes Connect. I could not because of nested frameworks, Realm.framework is in RealmSwift.frameworks and that is not "cool" with Apple. So I...

Realm not writing correctly

ios,swift,cocos2d-iphone,realm

You might need to explicitly set a default value for the value of damage in EnemyDB. Try changing it to this, and let me know if that works! class EnemyDB : RLMObject { var damage: Int = 0 } ...

Android Realm Migration version number based on what?

android,realm,realm-migration

Christian from Realm here. The migration API is still in a very experimental state and kinda ugly, so right now the version number always start with 0, and the only way for changing that is through a migration. This means that if you want a fresh install with a different...

Realm manual install issues on iOS

ios,realm

From the FAQ section of Realm docs: How big is the Realm library? Once your app is built for release, Realm should only add around 1MB to its size. The releases we distribute are significantly larger (~37MB for iOS & ~2.4MB for OSX) because they include support for more architectures...

Realm Swift 0.92.3 “Run Script Phase” not working

ios,xcode,realm

Make sure your framework is added to the Embedded Binaries and Embed Frameworks. While this is the first step that you're supposed to do: "Go to your Xcode project’s “General” settings. Drag RealmSwift.framework from the ios/ or osx/ directory to the “Embedded Binaries” section. Make sure Copy items if needed...

Meta inforation for RealmObject's entities?

android,realm

You could use static fields or the @Ignore annotation. Adding the @Ignore prevents realm from saving them into the DataBase, and you can still use getters and setters and add these with an interface....

Realm lexical or preprocessor 'RLMAccessor.h' file not found

ios,xcode,realm,ocmock

So I fixed it by upgrading to a newer GRUnit version then downgrading agin because GRUnit didn't work anymore and removing pod 'Realm/Headers' with pod 'Realm' and ran pod install again.

Realm.io Removing the realm file

ios,file,realm

That is the proper way of deleting it. You can check the Migration example in the RealmExample project that come with the SDK and see that that's exactly how they do it, so I assume the recommended way. let defaultPath = Realm.defaultPath NSFileManager.defaultManager().removeItemAtPath(defaultPath, error: nil) ...

realmDb initialization error

android,realm

Realm cannot find the native libraries for some reason. Are you using Android Studio or Eclipse. If you are using Eclipse, note that some extra setup is required as described here: http://realm.io/docs/java/0.79.0/#getting-started

Realm: Iterating a RealmObject and clearing an ArrayList field

java,android,iterator,realm

Since you are not actually removing elements that you are iterating over, you can just use a traditional for loop: for (int i = 0; i < mSections.size(); i++) { mSections.get(i).getEvents().clear(); } Note that if you did need to remove elements using an Iterator, you would need to use the...

List Or RealmList on Realm Android

java,android,realm

Christian from Realm here. You can only save objects that extend RealmObject inside a Realm. This is because Realm is not a schemaless database. We do require a schema and that schema is defined by your objects that extend RealmObject. We use RealmList because it abstracts away the communication with...

Fatal Error: use of unimplemented initializer 'init(realm:schema:)'

ios,swift,realm

I ran in the same problem the other day: Basically you should not create "init" methods but you can create "convenience init" methods. In that case you can't call super.init() but you call something like self.init() so in your case above you have to remove override init() and the other...

How to migrate Realm object that hasn't been stored?

ios,swift,migration,realm

So problem solved: What I didn't know is the fact, that I guess that the model object is set in all the realms existing in the app no matter whether I have stored it in them or not. The solution was to copy/paste the code RLMRealm.setSchemaVersion... for all the realm...

Rebuild Realm Database

ios,swift,realm

This happened to me too, a while back! Basically, just reset your your IOS Simulator that you are testing on. Click on "IOS Simulator" menu, then "Reset Contents And Settings" Let me know if this works......

Realm: Module was created by an older version of compiler and could not build objective-c module

ios,swift,realm

You'll have to wait for us to support Swift 2.0 (#2062) before you can use Realm Swift in your Swift 2.0 project. Because the framework written in Swift which was built in the old version compiler is not able to use in Xcode 7. Therefore, it will be needed to...

Refreshing multiple Realm instances at once?

java,android,multithreading,realm,event-bus

Realm uses a ThreadLocal cache internally pr. Realm file so it is practically free to call Realm.getInstance() in every activity/fragment/presenter you have. The first call to Realm.getInstance() will cost a little as database has to be opened and the schema verified, but after that it just cost a cache lookup....

How to have List property?

ios,swift,realm

You cant use List for that. List for to-many relationships However you can achieve what you want by combining all your strings into one, separated by a character. You use this func componentsSeparatedByString(_ separator: String) -> [AnyObject] afterwards to get your Array back from it....

Realm blocks Gson library

android,database,parsing,gson,realm

I found the issue: The problem was that I was using: Gson gson = new Gson(); Instead of what I should have used: Gson gson = new GsonBuilder() .setExclusionStrategies(new ExclusionStrategy() { @Override public boolean shouldSkipField(FieldAttributes f) { return f.getDeclaringClass().equals(RealmObject.class); } @Override public boolean shouldSkipClass(Class<?> clazz) { return false; } })...

Error when using Realm with Xcode 6.3.1

swift,cocoapods,realm

There was an issue on Realm's GitHub repository about that. Realm Swift's podspec makes use of some brand new CocoaPods features, so you will need to update CocoaPods to at least 0.37.1. Cleaning the cache and the existing installation and re-installing has proven to be helpful in that case: rm...

Realm - Add file with initial data to project (iOS/Swift)

ios,xcode,swift,realm

Implement this function openRealm in AppDelegate and call it in func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { ... openRealm() return true } func openRealm() { let defaultRealmPath = Realm.defaultPath let bundleReamPath = NSBundle.mainBundle().resourcePath?.stringByAppendingPathComponent("default.realm") if !NSFileManager.defaultManager().fileExistsAtPath(defaultRealmPath) { NSFileManager.defaultManager().copyItemAtPath(bundleReamPath!, toPath:...

Multiple Realms with multiple data models

ios,swift,realm

Having a different set of Object subclasses in each Realm isn't yet supported, but it will come with https://github.com/realm/realm-cocoa/issues/1584.

How to make a nested query in Realm?

realm

How about link query in documentation? There is an example: RealmResults<ChatRealm> contacts = realm.where(ChatRealm.class).equalTo("users.id", "some id").findAll(); ...

Realm - Share Database between Apps

java,android,database,realm

Christian from Realm here. Currently what you are asking is really not feasible. As others have pointed out there is really only two approaches. 1) Expose a ContentProvider. However that require you to map RealmResults to a Cursor which is not a trivial effort. We are planning on exposing a...

RealmResult Many-Many Relationship With Adapter

java,android,realm

Christian from Realm here. Currently there is unfortunately no other way than the one you found yourself if you don't want to maintain a RealmList<Playlist> field on the Song. That said we have a concept called Backlinks on our TODO which are exactly for use cases like this: https://github.com/realm/realm-java/issues/607

RealmSwift error: “RLMException, reason: Collection was mutated while being enumerated.”

swift,nspredicate,enumeration,realm

Thanks for the clarification. Since collectedSentences is a Realm List object, then deleting it would invalidate the results of the original query, which is what's causing the exception. One way to get around this (Which I've used in my own app before) is to make a static copy of the...

If I make a database on Realm, will it be accessible to my user without internet access?

ios,realm

Yep! Realm is a completely offline, local database solution. There's no online component, but if you do decide to, you can sync data from Realm online using third party cloud services like Parse (Or just literally copying the database file to Dropbox). By default, all data saved with Realm is...

Query Realm for all objects based on the size of a RLMArray property?

ios,swift,nspredicate,realm

That's a current limitation of Realm. Keypath Collection Queries are not yet supported.

Realm: query with property aggregation

ios,cocoa-touch,swift,realm

Realm currently does not support doing aggregate queries, so there's no one-liner to perform the query you want. Additionally, Realm is unable to query un-persisted properties (as balance is, in this case), because they are not in the database. Your best bet is to manually filter all of the Person...

RETROFIT POST Realm object

android,retrofit,realm

I found a workaround that requires 2 extra lines of code, and an extra serialisation step. @Inject ObjectMapper mObjectMapper; // I use Dagger2 for DI .... CreditCard creditCard = realm.createObject(CreditCard.class); card.setWhateverField(...); ... // I use Jackson's ObjectMapper to "copy" the original creditCard // to a new temporary instance that has...

Realm.io offline, Parse online - What about users

android,parse.com,realm

I also tried the combination of Realm and Parse. And yes you'll have to sync the data manually between both datasets by creating models for each. But I think writing (almost) the same model classes for both Parse and Realm could be counter-productive. That's why I dropped Realm and used...

Convert ISO 8601 strings to date in createOrUpdateInDefaultRealmWithObject

ios,json,swift,realm

Hi Dave there isn't anything built into Realm yet that can do that for you. You will need to use a transformer like Realm-JSON, or Mantle, etc.

Realm access from incorrect thread Android

java,android,multithreading,realm

If the problem is caused by calling onDataSetChanged and getViewAt from another thread, you can force them to use the same thread, creating your own HandlerThread like this: public class Lock { private boolean isLocked; public synchronized void lock() throws InterruptedException { isLocked = true; while (isLocked) { wait(); }...

How I can use Realm to parse a large JSON and storing data

android,json,android-volley,realm

Realm currently doesn't support primitive arrays. You JSON has this: "languages" : ["fr", "en"] For Realm to automatically map the JSON to your MyString class it would have to be converted to something like this: "languages" : [ { "str" : "fr"} , { "str" : "en" } ] You...

Realm.io Query with GroupBy

java,android,sql,orm,realm

Realm doesn't support GroupBy yet. Also be aware that beginGroup() is actually the same as parentheses. So your query is actually interpreted as : // SQL pseudo code SELECT * FROM Account WHERE (date = MONTH(date)) In Realm you would have to do something like this to select a single...

No public RealmResults Constructor?

java,android,realm

Since there was no way to do this directly, I ended up making my own adapter. public class BarAdapter extends ArrayAdapter<Bar> { //code to instantiate the adapter, inflate views, etc } This part was trivial, the only hard work to be done was by curating a query from Foo-->Bar that...

realm.objects().filter does not work with Resuts

swift,realm

The issue is that Results.filter(_:...) takes arguments of type (String, CVarArgType...) but Results does not conform to CVarArgType. I've just created GitHub issue #1995 to track this. The fix is pretty simple and I'd hope to have a PR up soon to address the issue. In the meantime, you could...

Completely remove RLMObject in Realm.io

swift,realm

A better way is to do realm.deleteAllObjects on your instance of the realm. More about that here http://realm.io/docs/cocoa/0.90.6/#deleting-objects. This removes all of your objects. If you want to remove one object, you can do realm.deleteObject(object here). There is more on that in the link above as well. Removing the file...

In Java, How do I cast a Realm Object into the class I wish to write to the Database?

android,class,object,casting,realm

All Realm classes extends RealmObject so you can use generics to accomplish it: public static <T extends RealmObject> void executeInsertInto(final Context context, final T passedObject){ Realm realm = Realm.getInstance(context); realm.executeTransaction(new Realm.Transaction() { @Override public void execute(Realm realm) { T itemToWrite = realm.copyToRealm(passedObject); } }); realm.close(); } ...

Debugging Realm in iOS 8.3

ios,swift,realm,ios8.3

You can download a device's container for your app from Xcode's "Devices" window with the following steps: Connect your device to your Mac. In the Devices window under Devices, select your device. Under Installed Apps, select the app from the list. From the Action menu (the gear icon), choose a...

Update Realm Object Android

android,realm

I found the solution as and It worked public void updateNewCard(Realm realm, VisitingCardPOJO card) { VisitingCardPOJO toEdit = realm.where(VisitingCardPOJO.class) .equalTo("no", card.getNo()).findFirst(); realm.beginTransaction(); toEdit.setName(card.getName()); toEdit.setAddress(card.getAddress()); realm.commitTransaction(); } ...

Limit number of calls in using Parse

android,database,many-to-many,realm

There are several ways to implement many-to-many relationships in Parse. You can use Arrays or Relations depending on the number of related objects. You can read more in Parse's documentation. In Parse Relations, you can add multiple objects in a relation before making a call. Let me take Book and...

Realm - Can't set object of type subclass to property of type parent class

realm

In Realm, while you can subclass your RLMObject entities, those subclasses aren't polymorphic. That is to say, you cannot substitute a Person object when you say you're linking to a Contact object, because Realm treats them as entirely separate entities.

Equivalent “completion handler” from MagicalRecord to Realm.io

ios,block,magicalrecord,realm,completion

the equivalent in Realm is -[RLMRealm transactionWithBlock:]. Since both your MagicalRecord example and Realm's equivalent run in the current thread, the completion block is a bit redundant because it's equivalent to adding code immediately after the call to this method....

Error on Android Realm copyToRealmOrUpdate when inserting existing records

android,realm

It is because you are combining mRealm.createObject() with mRealm.copyToRealmOrUpdate(). These two concepts are really orthogonal. Realm operates with a concept of "managed" and "standalone objects". Standalone objects is objects that are created using the normal new operator and are converted to managed objects when you use one of the mRealm.copyXXX...

Realm: How to add two Results<(Object)> in Realm

ios,swift,realm

Results does not support concatenation, but you can create a GeneratorOf that will yield the sum of the two results, or create an [Object] that is the non-lazy equivalent of that by doing let sum = map(array1) { $0 } + map(array2) { $0} ...

Delete all data from specific Realm Object Swift

swift,persistence,realm

You're looking for this: let realm = Realm() let deletedValue = "two" realm.write { let deletedNotifications = realm.objects(Notifications).filter("value == %@", deletedValue) realm.delete(deletedNotifications) } or perhaps this: let realm = Realm() let serverValues = ["one", "three"] realm.write { realm.delete(realm.objects(Notifications)) // deletes all 'Notifications' objects from the realm for value in serverValues...

Listing all records with realm causes crash

swift,realm

Your for should start at 0 and end at array.count - 1. In your case you can just use "<" instead of "<=" i < Int(allShuffle.count). You could also use the fast enumeration and not have any pb with objects count and index: for object in ShufflePerson.allObjects() { let shufflePerson...

Limit Realm results

android,realm

The cool thing is that you don't need to worry about that with Realm. The result object returned from a query is lazily loading the objects and its fields when you access them. Your objects are never copied and thus only represented ones in memory/disk. The (current) implementation detail of...

RealmBaseAdapter with section headers

android,listview,realm

RealmBaseAdapter doesn't work with ExpandableListAdapter (which I am assuming you are using for sections?), so right now your only choice is creating your own implementation. But a RealmResults is also a List so it should work seamlessly with an ArrayAdapter. You can also see more details here: https://github.com/realm/realm-java/issues/978...

iOS framework that dynamically links against Realm

ios,xcode,frameworks,realm

As mentioned in the comments, you shouldn't need to import the header in your umbrella header if you are importing it directly in Swift.

Is it possible to serialise a Realm Object into JSON?

ios,json,swift,realm

I don't believe there is any support officially, but this article may describe some other third party libraries which may be able to achieve what you are after http://blog.matthewcheok.com/working-with-realm/...

I have a model class, using which I save to realm. How do I use `contains()` to see if the object has already been stored

java,android,realm

Any reason you want to use contains? The below would be more precise: BasicSavedInfoImpl obj = realm.where(BasicSavedInfoImpl.class).equalTo("id", id).findFirst(); if (obj != null) { // success } If you want to use contains the following should work RealmResults<BasicSavedInfoImpl> objs = realm.where(BasicSavedInfoImpl.class).contains("id", id).findAll(); if (objs.size() > 0) { // success } But...

Realm.io - Is it possible to find object by its subobject?

android,realm

I think it i possible. You can check it out here: http://realm.io/docs/java/latest/#link-queries As per your case, you can try my following code: RealmResults<Doctor> rDoctors = realm.where(Doctor.class) .equalsTo("organization.organizationId", organizationId) .findAll(); return rDoctors; Please let me know if it works for you....