realm

Realm studio can't open new realm file generated from nodejs realm v6.1.1

非 Y 不嫁゛ 提交于 2021-02-17 05:48:06
问题 I'm trying to convert my json data to a .realm file, i think i'm succeeding since i see the default.realm file increasing size but when i try to open it using realm studio i get this error: I'm not sure what to do at this point. The realm/realm mongodb realm sync names are very confusing and links to docs go from one product to another which makes it a lot more confusing. 回答1: Realm is in the process of a change from Realm to MongoDB Realm The first, I call 'classic' Realm. That's going be be

How to use NSPredicate for whether a List of Int contains a Int number?

↘锁芯ラ 提交于 2021-02-17 03:56:50
问题 I got a Realm model Person who has a tag property. let tags = List<Int>() Now, I would like to perform a search like this realm.objects(Person.self).filter(NSPredicate(format: "\(tagID) IN tags")) // "0 IN tags" Error: Terminating app due to uncaught exception 'Invalid value', reason: 'Expected object of type (null) for property 'tags' on object of type 'Person', but received: 0' 回答1: As stated in David's comment, you cannot filter on a list of primitives. You can only filter on List's that

In swift, is there a way to add new data from second Realm bundle, without overwriting any existing data in the current Default Realm?

馋奶兔 提交于 2021-02-16 15:26:30
问题 Upon initial load of the app, the Bundled Realm (Realm1) is copied to the documents folder. Now that the bundled realm is set as the default realm, I am able update the bool property so that the table view can show marked and unmarked cells. However I am looking for a way to bundle a second realm (Realm2) with a later update, that will add new data to the existing default realm, but without overwriting the current default realm. I am currently working in swift 5 and Xcode 11.1, if that is

Shiro入门学习与实战(一)

强颜欢笑 提交于 2021-02-12 09:56:39
一、概述 1、Shiro是什么?   Apache Shiro是java 的一个安全框架,主要提供:认证、授权、加密、会话管理、与Web集成、缓存等功能,其不依赖于Spring即可使用;   Spring Security(Oauth2)也是一个开源的权限框架,但其依赖于Spring运行,功能相对强大;而Shiro相对独立,不依赖于Spring,使用简单、灵活,所以我选择Shiro学习。哈哈~ 2、Shiro基本功能 ①Authentication(音标: [ɔːˌθentɪˈkeɪʃn] )   身份认证,验证用户是不是拥有相应的身份。 ②Authorization(音标:[ˌɔːθərəˈzeɪʃn])   授权即权限验证,验证某个已认证的用户是否拥有某个权限(比如接下来我要实现的:不用用户拥有不用的菜单树) ③Session Management   会话管理,在用户登录后,退出之前,所有信息都存在于会话中(这里可以用于sso单点登录) ④Crptography   加密,保护数据的安全性(比如密码加密存储到数据库,而不是明文存储) ⑤Web支持   非常容易集成到Web环境 ⑥Caching   缓存,比如用户登录后,其用户信息、拥有的角色/权限不必每次去查,这样可以提高效率 ⑦Concurrency   Shiro支持多线程应用宝并发验证,(即在一个线程中开启另一个线程

How to read and filter large Realm dataset in SwiftUI?

▼魔方 西西 提交于 2021-02-11 12:24:47
问题 I'm storing ~100.000 dictionary entries in a realm database and would like to display them. Additionally I want to filter them by a search field. Now I'm running in a problem: The search function is really inefficient although I've tried to debounce the search. View Model: class DictionaryViewModel : ObservableObject { let realm = DatabaseManager.sharedInstance @Published var entries: Results<DictionaryEntry>? @Published var filteredEntries: Results<DictionaryEntry>? @Published var searchText

Use Realm Query Results as UITableView Section Headers

独自空忆成欢 提交于 2021-02-11 09:40:30
问题 I am trying to use results from a Realm query as section headers in a UITableView. Realm classes: class Person: Object { @objc dynamic var personId = UUID().uuidString @objc dynamic var firstName: String = "" @objc dynamic var surname: String = "" @objc dynamic var mobileNumber: Int = 0 @objc dynamic var password: String = "" override static func primaryKey() -> String? { return "personId" } } class Category: Object { @objc dynamic var categoryId = UUID().uuidString @objc dynamic var person:

Use Realm Query Results as UITableView Section Headers

纵饮孤独 提交于 2021-02-11 09:39:02
问题 I am trying to use results from a Realm query as section headers in a UITableView. Realm classes: class Person: Object { @objc dynamic var personId = UUID().uuidString @objc dynamic var firstName: String = "" @objc dynamic var surname: String = "" @objc dynamic var mobileNumber: Int = 0 @objc dynamic var password: String = "" override static func primaryKey() -> String? { return "personId" } } class Category: Object { @objc dynamic var categoryId = UUID().uuidString @objc dynamic var person:

How to transfer Realm database to appgroups

浪尽此生 提交于 2021-02-11 08:27:28
问题 Hey I have an app that uses Real to persist data. I used the default realm file directory to store the apps data but I would like to move the file directory to app groups in order to create app extensions. Heres my code for changing the file path var config = Realm.Configuration() config.fileURL = FileManager.default.containerURL(forSecurityApplicationGroupIdentifier: "group.com.bundle.identifier")!.appendingPathComponent("default.realm") Realm.Configuration.defaultConfiguration = config The

How do I show 2 different color dots for a date using FSCalendar?

给你一囗甜甜゛ 提交于 2021-02-10 23:43:09
问题 Beginner programmer here. I am trying to show two different color dots if there is a negative AND a positive transaction for that date. Here is my code. It only shows one dot. func calendar(_ calendar: FSCalendar, numberOfEventsFor date: Date) -> Int { let incomeTransaction = realm.objects(Transaction.self).filter(positiveTransactionPredicate(date: date)) let expenseTransaction = realm.objects(Transaction.self).filter(negativeTransactionPredicate(date: date)) for _ in incomeTransaction {

How do I show 2 different color dots for a date using FSCalendar?

南笙酒味 提交于 2021-02-10 23:41:46
问题 Beginner programmer here. I am trying to show two different color dots if there is a negative AND a positive transaction for that date. Here is my code. It only shows one dot. func calendar(_ calendar: FSCalendar, numberOfEventsFor date: Date) -> Int { let incomeTransaction = realm.objects(Transaction.self).filter(positiveTransactionPredicate(date: date)) let expenseTransaction = realm.objects(Transaction.self).filter(negativeTransactionPredicate(date: date)) for _ in incomeTransaction {