Join us at MongoDB.local London on 7 May to unlock new possibilities for your data. Use WEB50 to save 50%.
Register now >
Docs Menu
Docs Home
/ /
Sync Data

Manage Flexible Sync Subscriptions - Swift SDK

New in version 10.22.0.

Flexible Sync utiliza suscripciones y permisos para determinar qué datos sincronizar con tu aplicación.

To use Flexible Sync in an iOS client:

  • Configure Flexible Sync on the backend

  • Initialize the app

  • Authenticate a user in your client project.

  • Abra el reino sincronizado con una configuración de sincronización flexible

  • Agrega suscripciones a la aplicación cliente

Puedes añadir, actualizar y eliminar manualmente suscripciones para determinar qué datos se sincronizan con el dispositivo cliente. En la versión 10.43.0 y posteriores del SDK de Realm Swift, puedes suscribirte a queries en vez de, o además de, gestionar manualmente suscripciones.

Tip

Cuando configuras la sincronización flexible en el backend, especificas qué campos puede consultar tu aplicación cliente usando suscripciones.

Each subscription corresponds to a query on queryable fields for a specific object type. See Queryable Fields in the App Services documentation for more information.

For each query subscription, Realm looks for data matching the query. Data matching the subscription, where the user has the appropriate permissions, syncs between clients and the backend application.

You can construct queries with the Realm Swift SDK query engine.

Subscription sets are based on object type. You might have multiple subscriptions if you have many types of Realm objects. You can also have multiple subscriptions on the same object type.

However, note the following if you use relationships or asymmetric objects in your app:

You must add both an object and its linked object to the subscription set to see a linked object.

If your subscription results contain an object with a property that links to an object not contained in the results, the link appears to be nil. There is no way to distinguish whether that property's value is legitimately nil, or whether the object it links to exists but is out of view of the query subscription.

Si tu aplicación utiliza Data Ingest para sincronizar objetos asimétricos de forma unidireccional, no podrás crear suscripciones para esos objetos. Si tu aplicación contiene objetos asimétricos y no asimétricos en el mismo realm, puedes añadir queries de suscripción de Flexible Sync para los objetos no asimétricos.

Subscriptions work hand-in-hand with permissions to determine what data to Sync to your client application. The client application only sees the subset of data that matches your subscriptions which also matches the permissions of the logged-in user.

Esta página detalla cómo administrar las suscripciones de clientes para Sincronización Flexible. Para obtener información sobre cómo configurar permisos para Sincronización Flexible, consulte: Reglas y permisos de Sincronización Flexible.

In the client application, you add, update, and remove subscriptions to specific queries on the queryable fields. This determines which data syncs to the client device.

Puede:

  • Add subscriptions with an optional subscription name:

    • En la versión 10.43.0 y posteriores del SDK de Realm Swift, puedes usar .subscribe() Suscribirse a la consulta Results. Esto añade automáticamente la suscripción al conjunto de suscripciones.

    • Manually add a subscription to the subscription set with the subscriptions API. Use this API if you need more control over subscriptions for performance optimization or business logic reasons. See Performance Considerations for more information.

  • React to subscription state

  • Actualiza las suscripciones con nuevas queries

  • Remover suscripciones individuales o todas las suscripciones de un tipo de objeto Realm.

The examples on this page use a simple data set for a task list app. The two Realm object types are Team and Task. A Task has a taskName, assignee's name, and completed flag. There is also a count of minutes spent working on it, and a due date. A Team has a teamName, zero or more Tasks, and a list of members.

class Task: Object {
@Persisted(primaryKey: true) var _id: ObjectId
@Persisted var taskName: String
@Persisted var assignee: String?
@Persisted var completed: Bool
@Persisted var progressMinutes: Int
@Persisted var dueDate: Date
}
class Team: Object {
@Persisted(primaryKey: true) var _id: ObjectId
@Persisted var teamName: String
@Persisted var tasks: List<Task>
@Persisted var members: List<String>
}

Los ejemplos en esta página también suponen que tienes un usuario autorizado y una configuración de Flexible Sync:

let app = App(id: APPID)
do {
let credentials = emailPasswordCredentials(app: app)
let user = try await app.login(credentials: credentials)
var flexSyncConfig = user.flexibleSyncConfiguration()
flexSyncConfig.objectTypes = [Task.self, Team.self]
do {
// Open the synced realm and manage Flexible Sync subscriptions
} catch {
print("Failed to open realm: \(error.localizedDescription)")
// handle error
}
} catch {
fatalError("Login failed: \(error.localizedDescription)")
}

Novedad en la versión 10.43.0.

To simplify subscription management, Realm Swift SDK version 10.43.0 adds APIs to subscribe and unsubscribe from a query's Results set. These APIs abstract away the details of manually adding and removing subscriptions.

Importante

El .subcribe() La API está en vista previa

The .subscribe() and .unsubscribe() APIs described here are currently in Preview. These APIs may be subject to changes in the future.

Con un usuario autenticado y una configuración de Sincronización Flexible, puede abrir un dominio sincronizado y consultar los objetos que desea leer y escribir. Puede usar la función "subscribe()" para crear una suscripción de Sincronización Flexible para los objetos que coincidan con la consulta:

let realm = try await Realm(configuration: flexSyncConfig)
let results = try await realm.objects(Task.self)
.where { $0.progressMinutes >= 60 }.subscribe()
// Go on to work with subscribed results

Esto crea una suscripción sin nombre y la añade a la MutableSubscriptionSet, similar a crear una suscripción manualmente.

If your app works with multiple subscriptions, or if you want to update a subscription, you may want to add a name when you subscribe to a query.

Posteriormente, puedes usar este nombre para actualizar una query de suscripción, comprobar una suscripción por nombre o eliminar la query por nombre.

let realm = try await Realm(configuration: flexSyncConfig)
let results = try await realm.objects(Team.self)
.where { $0.teamName == "Developer Education" }
.subscribe(name: "team_developer_education")
// Go on to work with subscribed results

When you subscribe to a query's Results set, that set does not contain objects until it syncs. If your app creates objects, you may not need to download synced data before the user works with it. However, if your app requires data from the server before the user can work with it, you can specify that a subscription should waitForSync:

let realm = try await Realm(configuration: flexSyncConfig)
let results = try await realm.objects(Team.self)
.where { $0.members.contains("Bob Smith") }
.subscribe(
name: "bob_smith_teams",
waitForSync: .onCreation)
// After waiting for sync, the results set contains all the objects
// that match the query - in our case, 1
print("The number of teams that have Bob Smith as a member is \(results.count)")

Esta opción utiliza el enum RLMWaitForSyncMode, cuyos casos son:

  • .onCreation: Wait to download matching objects when your app creates the subscription. Otherwise, return without waiting for new downloads. The app must have an internet connection the first time you add the subscription.

  • .always: Wait to download matching objects when .subscribe() is executed. The app must have an internet connection when .subscribe() is executed.

  • .never: Never wait to download matching objects. The app needs an internet connection for the user to authenticate the first time the app launches, but can open offline on subsequent launches using cached credentials.

You can optionally specify a timeout value of type TimeInterval.

Puede cancelar la suscripción al conjunto de una Results consulta utilizando la API .unsubscribe():

let realm = try await Realm(configuration: flexSyncConfig)
let results = try await realm.objects(Task.self).where { $0.completed == false }.subscribe()
// Go on to work with subscribed results.
// Later...
results.unsubscribe()

Esto elimina la suscripción de, de forma MutableSubscriptionSet similar a eliminar una suscripción manualmente.

A Results set may still contain objects after calling .unsubscribe() if another subscription exists that contains overlapping objects.

Llamar a .unsubscribe() no espera a que se eliminen los objetos del dominio. No hay ninguna API que espere a que .unsubscribe() se sincronice con el servidor.

Puedes suscribirte a una query restringida por actor en el MainActor:

let realm = try await Realm(configuration: flexSyncConfig, actor: MainActor.shared)
let results = try await realm.objects(Team.self)
.where { $0.teamName == "Developer Education" }
.subscribe(name: "team_developer_education")
// Go on to work with subscribed results

Or subscribe to a query on a custom actor:

let realm = try await Realm(configuration: flexSyncConfig, actor: CustomGlobalActor.shared)
let results = try await realm.objects(Team.self)
.where { $0.teamName == "Developer Education" }
.subscribe(name: "team_developer_education")
// Go on to work with subscribed results

Para obtener más información sobre los ámbitos confinados de actor, consulte Usar Realm con Actores - Swift SDK.

You can use the subscriptions API to manually manage a set of subscriptions to specific queries on queryable fields.

Puede:

  • Add subscriptions

  • React to subscription state

  • Actualiza las suscripciones con nuevas queries

  • Remover suscripciones individuales o todas las suscripciones de un tipo de objeto Realm.

Data matching the subscription, where the user has the appropriate permissions, syncs between devices and the backend application.

You can specify an optional string name for your subscription.

When you create a subscription, Realm looks for data matching a query on a specific object type. You can have multiple subscription sets on different object types. You can also have multiple queries on the same object type.

Ejemplo

You can create a subscription with an explicit name. Then, you can search for that subscription by name to update or remove it.

QuerySubscription<Task>(name: "long-running-completed") {
$0.completed == true && $0.progressMinutes > 120
}

Si no especificas un name para una suscripción, puedes buscar la suscripción por el string del query.

QuerySubscription<Team> {
$0.teamName == "Developer Education"
}

Nota

Suscripciones duplicadas

Subscription names must be unique. Trying to append a subscription with the same name as an existing subscription throws an error.

If you do not explicitly name a subscription, and instead subscribe to the same unnamed query more than once, Realm does not persist duplicate queries to the subscription set.

Si te suscribes a la misma query más de una vez con diferentes nombres, Realm mantiene ambas suscripciones en el conjunto de suscripción.

Agrega una suscripción en un bloque de actualización de suscripciones. Se añade cada nueva suscripción a las suscripciones del cliente en Realm.

Tip

If your app accesses Realm in an async/await context, mark the code with @MainActor to avoid threading-related crashes.

let realm = try await getRealmWithSingleSubscription()
// Opening a realm and accessing it must be done from the same thread.
// Marking this function as `@MainActor` avoids threading-related issues.
@MainActor
func getRealmWithSingleSubscription() async throws -> Realm {
let realm = try await Realm(configuration: flexSyncConfig)
let subscriptions = realm.subscriptions
try await subscriptions.update {
subscriptions.append(
QuerySubscription<Team> {
$0.teamName == "Developer Education"
})
}
return realm
}

You can add multiple subscriptions within a subscription update block, including subscriptions of different object types.

let realm = try await getRealmWithMultipleSubscriptions()
// Opening a realm and accessing it must be done from the same thread.
// Marking this function as `@MainActor` avoids threading-related issues.
@MainActor
func getRealmWithMultipleSubscriptions() async throws -> Realm {
let realm = try await Realm(configuration: flexSyncConfig)
let subscriptions = realm.subscriptions
try await subscriptions.update {
subscriptions.append(
QuerySubscription<Task>(name: "completed-tasks") {
$0.completed == true
})
subscriptions.append(
QuerySubscription<Team> {
$0.teamName == "Developer Education"
})
}
return realm
}

New in version 10.28.0.

Debe tener al menos una suscripción para poder leer o escribir en el dominio. Puede iniciar un dominio con una suscripción inicial al abrirlo con flexibleSyncConfiguration(). Pase el initialSubscriptions parámetro con las consultas de suscripción que desee usar para iniciar el dominio:

var flexSyncConfig = user.flexibleSyncConfiguration(initialSubscriptions: { subs in
subs.append(
QuerySubscription<Team> {
$0.teamName == "Developer Education"
})
})

Si tu aplicación necesita volver a ejecutar esta suscripción inicial cada que la aplicación se inicia, puedes pasar un parámetro adicional - rerunOnOpen. Este es un booleano que indica si la suscripción inicial debe ejecutarse nuevamente cada vez que se inicie la aplicación. Es posible que debas hacer esto para volver a ejecutar rangos de tiempo dinámicos u otras queries que requieran un recálculo de variables estáticas para la suscripción.

In this example, we don't want users to be overwhelmed by irrelevant tasks, so we'll load only tasks due within the previous 7 days and the next 7 days. Tasks that were due more than a week ago are no longer relevant, and tasks that are due further out than the next week are also not relevant. With rerunOnOpen here, the query dynamically recalculates the relevant objects to sync based on the desired date range every time the app starts.

// Set the date a week ago and the date a week from now, as those are the dates we'll use
// in the Flexible Sync query. `rerunOnOpen` lets the app recalculate this query every
// time the app opens.
let secondsInAWeek: TimeInterval = 604800
let dateLastWeek = (Date.now - secondsInAWeek)
let dateNextWeek = (Date.now + secondsInAWeek)
var flexSyncConfig = user.flexibleSyncConfiguration(initialSubscriptions: { subs in
subs.append(
QuerySubscription<Task> {
$0.dueDate > dateLastWeek && $0.dueDate < dateNextWeek
})
}, rerunOnOpen: true)

Además de sincronizar todos los objetos que coinciden con una query determinada, puedes suscribirte a todos los objetos de un tipo específico. Puedes hacerlo agregando una suscripción sin proporcionar una query.

Por ejemplo, si no quieres ver un equipo específico, pero en cambio quieres suscribirte a todos los objetos de Team, podrías hacer esto:

let realm = try await subscribeToObjectsOfAType()
// Opening a realm and accessing it must be done from the same thread.
// Marking this function as `@MainActor` avoids threading-related issues.
@MainActor
func subscribeToObjectsOfAType() async throws -> Realm {
let realm = try await Realm(configuration: flexSyncConfig)
let subscriptions = realm.subscriptions
try await subscriptions.update {
subscriptions.append(QuerySubscription<Team>(name: "all_teams"))
}
XCTAssertEqual(subscriptions.count, 1) // :remove
return realm
}

If your application flow appends the same named subscription to the subscription set every time you run the application, this is disallowed. In this case, add a check for an existing subscription before appending it:

let realm = try await checkAndAddSubscription()
// Opening a realm and accessing it must be done from the same thread.
// Marking this function as `@MainActor` avoids threading-related issues.
@MainActor
func checkAndAddSubscription() async throws -> Realm {
let realm = try await Realm(configuration: flexSyncConfig)
let subscriptions = realm.subscriptions
let foundSubscription = subscriptions.first(named: "user_team")
try await subscriptions.update {
if foundSubscription != nil {
foundSubscription!.updateQuery(toType: Team.self, where: {
$0.teamName == "Developer Education"
})
} else {
subscriptions.append(
QuerySubscription<Team>(name: "user_team") {
$0.teamName == "Developer Education"
})
}
}
return realm
}

Actualizar el conjunto de suscripciones localmente es solo un componente del cambio de suscripción. Después del cambio de suscripción local, el realm se sincroniza con el servidor para resolver cualquier actualización de datos debido al cambio de suscripción. Esto podría significar agregar o remover datos del realm sincronizado.

If your application does not use Swift's async/await feature, you can react to subscription changes syncing with the server using the onComplete block. This block is called after subscriptions are synchronized with the server. If you want to react to subscription state changes by redrawing a UI, for example, or taking another action based on changes to the data set, take those actions in onComplete. This is also where you can handle optional errors that occur during synchronization.

let subscriptions = realm.subscriptions
subscriptions.update({
subscriptions.append(
QuerySubscription<Task> {
$0.assignee == "John Doe"
})
}, onComplete: { error in // error is optional
if error == nil {
// Flexible Sync has updated data to match the subscription
} else {
// Handle the error
}
})

If your application uses async/await, you don't need the onComplete block. The update executes asynchronously and throws an error if the update cannot complete successfully.

@MainActor
func changeSubscription() async throws {
let subscriptions = realm.subscriptions
try await subcriptions.update {
subscriptions.remove {
QuerySubscription<Task> {
$0.assignee == "Joe Doe"
}
}
}
}

Tip

If your app accesses Realm in an async/await context, mark the code with @MainActor to avoid threading-related crashes.

Utilice la propiedad SubscriptionSet.state para leer el estado actual del conjunto de suscripciones.

El superseded estado es un SyncSubscriptionState que puede ocurrir cuando otro subproceso actualiza una suscripción en una instancia diferente del conjunto de suscripciones. Si el estado cambia superseded a, debe obtener una nueva instancia del conjunto de suscripciones para poder actualizarlo.

Nota

Estado de suscripción 'Completo'

The subscription set state "complete" does not mean "sync is done" or "all documents have been synced". "Complete" means the following two things have happened:

  • The subscription has become the active subscription set that is currently being synchronized with the server.

  • The documents that matched the subscription at the time the subscription was sent to the server are now on the local device. Note that this does not necessarily include all documents that currently match the subscription.

El SDK de Realm no proporciona una manera de verificar si todos los documentos que coinciden con una suscripción se han sincronizado con el dispositivo.

Se puede actualizar la query de una suscripción utilizando updateQuery. En este ejemplo, buscamos una subscripción que coincida con nuestra query y luego la actualizamos con una nueva query.

let realm = try await getRealmWithUpdatedSubscriptions()
// Opening a realm and accessing it must be done from the same thread.
// Marking this function as `@MainActor` avoids threading-related issues.
@MainActor
func getRealmWithUpdatedSubscriptions() async throws -> Realm {
let realm = try await Realm(configuration: flexSyncConfig)
let subscriptions = realm.subscriptions
try await subscriptions.update {
if let foundSubscription = subscriptions.first(ofType: Team.self, where: {
$0.teamName == "Developer Education"
}) {
foundSubscription.updateQuery(toType: Team.self, where: {
$0.teamName == "Documentation"
})
}
}
return realm
}

También puedes buscar una suscripción por nombre. En este ejemplo, buscamos una consulta de suscripción por nombre y la actualizamos con una nueva consulta.

let realm = try await getRealmWithUpdatedSubscriptionName()
// Opening a realm and accessing it must be done from the same thread.
// Marking this function as `@MainActor` avoids threading-related issues.
@MainActor
func getRealmWithUpdatedSubscriptionName() async throws -> Realm {
let realm = try await Realm(configuration: flexSyncConfig)
let subscriptions = realm.subscriptions
let foundSubscription = subscriptions.first(named: "user-team")
try await subscriptions.update {
foundSubscription?.updateQuery(toType: Team.self, where: {
$0.teamName == "Documentation"
})
}
return realm
}

To remove subscriptions, you can:

  • Remove a single subscription query

  • Remove all subscriptions to a specific object type

  • Remover todas las suscripciones sin nombre

  • Remove all subscriptions

Cuando elimina una consulta de suscripción, Realm elimina de forma asincrónica los datos sincronizados que coinciden con la consulta del dispositivo cliente.

You can remove a specific subscription query in a subscription update block using remove. Specify the query by name or use the query as a string to find the appropriate subscription query to remove.

let realm = try await getRealmAfterRemovingSubscription()
// Opening a realm and accessing it must be done from the same thread.
// Marking this function as `@MainActor` avoids threading-related issues.
@MainActor
func getRealmAfterRemovingSubscription() async throws -> Realm {
let realm = try await Realm(configuration: flexSyncConfig)
let subscriptions = realm.subscriptions
// Look for a specific subscription, and then remove it
let foundSubscription = subscriptions.first(named: "docs-team")
try await subscriptions.update {
subscriptions.remove(foundSubscription!)
}
// Or remove a subscription that you know exists without querying for it
try await subscriptions.update {
subscriptions.remove(named: "existing-subscription")
}
return realm
}

If you want to remove all subscriptions to a specific object type, use the removeAll method with ofType in a subscription update block.

let realm = try await getRealmAfterRemovingAllSubscriptionsToAnObjectType()
// Opening a realm and accessing it must be done from the same thread.
// Marking this function as `@MainActor` avoids threading-related issues.
@MainActor
func getRealmAfterRemovingAllSubscriptionsToAnObjectType() async throws -> Realm {
let realm = try await Realm(configuration: flexSyncConfig)
let subscriptions = realm.subscriptions
try await subscriptions.update {
subscriptions.removeAll(ofType: Team.self)
}
return realm
}

Novedad en la versión 10.43.0.

Es posible que desee eliminar las suscripciones sin nombre que son transitorias o generadas dinámicamente, pero dejar las suscripciones con nombre en su lugar.

Puede eliminar todas las suscripciones sin nombre del conjunto de suscripciones configurando unnamedOnly en true cuando llame al método removeAll:

let realm = try await Realm(configuration: flexSyncConfig)
// Add 2 subscriptions, one named and one unnamed.
let results = try await realm.objects(Team.self).where { $0.teamName == "Developer Education" }.subscribe(name: "team_developer_education")
let results2 = try await realm.objects(Task.self).where { $0.completed == false }.subscribe()
// Later, remove only the unnamed one
let subscriptions = realm.subscriptions
try await subscriptions.update {
subscriptions.removeAll(unnamedOnly: true)
}

To remove all subscriptions from the subscription set, use the removeAll method in a subscription update block.

Importante

Si elimina todas las suscripciones y no agrega una nueva, obtendrá un error. Un realm abierto con una configuración de sincronización flexible necesita al menos una suscripción para sincronizar con el servidor.

let realm = try await getRealmAfterRemovingAllSubscriptions()
// Opening a realm and accessing it must be done from the same thread.
// Marking this function as `@MainActor` avoids threading-related issues.
@MainActor
func getRealmAfterRemovingAllSubscriptions() async throws -> Realm {
let realm = try await Realm(configuration: flexSyncConfig)
let subscriptions = realm.subscriptions
try await subscriptions.update {
subscriptions.removeAll()
}
return realm
}

Adding several subscriptions with the .subscribe() and .unsubscribe() APIs described in the Subscribe to Queries section is less efficient than performing batch updates when you manually manage subscriptions. On every .subscribe(), the Swift SDK opens a new update block. For better performance adding multiple subscriptions, use the subscriptions.update API described in the Manually Manage Subscriptions section.

Every write transaction for a subscription set has a performance cost. If you need to make multiple updates to a Realm object during a session, consider keeping edited objects in memory until all changes are complete. This improves sync performance by only writing the complete and updated object to your realm instead of every change.

Adding an indexed queryable field to your App can improve performance for simple queries on data that is strongly partitioned. For example, an app where queries strongly map data to a device, store, or user, such as user_id == $0, “641374b03725038381d2e1fb”, is a good candidate for an indexed queryable field. However, an indexed queryable field has specific requirements for use in a query subscription:

  • The indexed queryable field must be used in every subscription query. It cannot be missing from the query.

  • The indexed queryable field must use an == or IN comparison against a constant at least once in the subscription query. (El campo consultable debe utilizar una comparación o contra una constante al menos una vez en la consulta de suscripción.) For example, user_id == $0, "641374b03725038381d2e1fb" or store_id IN $0, {1,2,3}. (Por ejemplo, o .)

Opcionalmente, puedes incluir una comparación de AND siempre que el campo indexado consultable se compare directamente con una constante usando == o IN al menos una vez. Por ejemplo, store_id IN {1,2,3} AND region=="Northeast" o store_id == 1 AND (active_promotions < 5 OR num_employees < 10).

Invalid Flexible Sync queries on an indexed queryable field include queries where:

  • The indexed queryable field does not use AND with the rest of the query. For example store_id IN {1,2,3} OR region=="Northeast" is invalid because it uses OR instead of AND. Similarly, store_id == 1 AND active_promotions < 5 OR num_employees < 10 is invalid because the AND only applies to the term next to it, not the entire query.

  • El campo consultable indexado no se utiliza en un operador de igualdad. Por ejemplo, store_id > 2 AND region=="Northeast" no es válido porque solo utiliza el operador > con el campo consultable indexado y no tiene una comparación de igualdad.

  • The query is missing the indexed queryable field entirely. For example, region=="Northeast or truepredicate are invalid because they do not contain the indexed queryable field.

Flexible Sync has some limitations when using RQL operators. When you write the query subscription that determines which data to sync, the server does not support these query operators. However, you can still use the full range of RQL features to query the synced data set in the client application.

Tipo de operador
Operadores no compatibles

Aggregate Operators

@avg, @count, @max, @min, @sum

Query Suffixes

DISTINCT, SORT, LIMIT

Las queries que no distinguen entre mayúsculas y minúsculas ([c]) no pueden usar índices de manera eficaz. Como resultado, no se recomiendan las queries que no distinguen entre mayúsculas y minúsculas, ya que podrían provocar problemas de rendimiento.

Flexible Sync only supports @count for array fields.

Flexible Sync admite la consulta de listas usando el operador IN.

Puede consultar una lista de constantes para ver si contiene el valor de un campo consultable:

// Query a constant list for a queryable field value
"priority IN { 1, 2, 3 }"

If a queryable field has an array value, you can query to see if it contains a constant value:

// Query an array-valued queryable field for a constant value
"'comedy' IN genres"

Advertencia

You cannot compare two lists with each other in a Flexible Sync query. Note that this is valid Realm Query Language syntax outside of Flexible Sync queries.

// Invalid Flexible Sync query. Do not do this!
"{'comedy', 'horror', 'suspense'} IN genres"
// Another invalid Flexible Sync query. Do not do this!
"ANY {'comedy', 'horror', 'suspense'} != ANY genres"

Flexible Sync does not support querying on properties in Embedded Objects or links. For example, obj1.field == "foo".

The size limit for any given query subscription in your subscription set is 256 kB. Exceeding this limit results in a LimitsExceeded Error.

Volver

Configure & Open a Synced Realm