Example #1
0
        public void RemoveMany(IList <PackedObject> items)
        {
            Dbg.Trace($"remove many called for {items.Count} items");

            foreach (var item in items)
            {
                foreach (var metadata in CollectionSchema.ServerSide)
                {
                    if (metadata.IndexType == IndexType.Unique)
                    {
                        _dataByUniqueKey[metadata.Name].Remove(item[metadata.Order]);
                    }
                }

                // if present remove it from the full-text index
                _fullTextIndex?.DeleteDocument(item.PrimaryKey);

                EvictionPolicy.TryRemove(item);
            }

            foreach (var index in _dataByIndexKey)
            {
                index.Value.RemoveMany(items);
            }


            foreach (var o in items)
            {
                DataByPrimaryKey.Remove(o.PrimaryKey);
            }
        }
Example #2
0
        public PackedObject RemoveByPrimaryKey(KeyValue primary)
        {
            var removed = InternalRemoveByPrimaryKey(primary);

            if (removed != null)
            {
                EvictionPolicy.TryRemove(removed);
            }

            return(removed);
        }