putAllByIndex method

  1. @override
Future<List<Id>> putAllByIndex(
  1. String indexName,
  2. List<OBJ> objects
)
override

Insert or update a list of objects by the unique index indexName. Returns the list of ids of the new or updated objects.

If there is already an object with the same index key, it will be updated and all links will be preserved. Otherwise a new object will be inserted.

If the objects have an non-final id property, it will be set to the assigned id. Otherwise you should use the returned ids to update the objects.

If possible, you should use the generated type-safe methods instead.

Implementation

@override
Future<List<Id>> putAllByIndex(String indexName, List<OBJ> objects) {
  return _spanHelper.asyncWrapInSpan(
    'putAllByIndex',
    () {
      return _isarCollection.putAllByIndex(indexName, objects);
    },
    dbName: _dbName,
    collectionName: name,
  );
}