DocCollection:add(value: any) -> stringAppend a value under a fresh key and return the new entry's id — the same id on_add's meta carries and ack takes. Your own on_add sees the entry exactly once, like everyone else's.
handle4 methods
An append-only view over one key prefix of a document. Up to max distinct entries reach on_add exactly once each: those already in the document, those written later, and your own adds. Entries past max still sync and are counted by count(); they just fire no callback.
Document:collectionDocCollection:add(value: any) -> stringAppend a value under a fresh key and return the new entry's id — the same id on_add's meta carries and ack takes. Your own on_add sees the entry exactly once, like everyone else's.
DocCollection:ack(id: string)Anonymously acknowledge an entry, by the id on_add's meta carried. The entry's author learns through its on_ack that the entry has a reader — nothing identifies which reader, and the receipt carries no proof. Fire-and-forget: delivery is best-effort, like messaging.
DocCollection:count() -> integerDistinct entries observed so far -- including entries past the collection's max, which count here without reaching on_add.
DocCollection:unsubscribe()Stop listening: on_add and on_ack no longer fire, and count() reads 0. Calling it again does nothing.