Uploaded image for project: 'Couchbase Lite'
  1. Couchbase Lite
  2. CBL-4304

Database's Document APIs are deprecated

    XMLWordPrintable

Details

    • 2

    Description

      Starting from CBL 3.1, collections will be used as document storage. The documents stored in the database prior CBL 3.1 will be stored in the default collection. All document APIs in the Database class will be deprecated, and the corresponding alternative APIs can be found in the Collection class.

      Deprecated APIs

      Java / Android

      • long getCount()
      • Document getDocument(@Nonull String id)
      • void save(@NonNull MutableDocument document) throws CouchbaseLiteException
      • boolean save(@NonNull MutableDocument document, @NonNull ConcurrencyControl concurrencyControl) throws CouchbaseLiteException
      • boolean save(@NonNull MutableDocument document, @NonNull ConflictHandler conflictHandler) throws CouchbaseLiteException
      • void delete(@NonNull Document document) throws CouchbaseLiteException
      • boolean delete(@NonNull Document document, @NonNull ConcurrencyControl concurrencyControl) throws CouchbaseLiteException
      • void purge(@NonNull Document document) throws CouchbaseLiteException
      • void purge(@NonNull String id) throws CouchbaseLiteException
      • void setDocumentExpiration(@NonNull String id, @Nullable Date expiration) throws CouchbaseLiteException
      • Date getDocumentExpiration(@NonNull String id) throws CouchbaseLiteException
      • ListenerToken addChangeListener(@NonNull DatabaseChangeListener listener)
      • ListenerToken addChangeListener(@Nullable Executor executor, @NonNull DatabaseChangeListener listener)
      • ListenerToken addDocumentChangeListener(@NonNull String docId, @NonNull DocumentChangeListener listener)
      • ListenerToken addDocumentChangeListener(@NonNull String docId, @Nullable Executor executor, @NonNull DocumentChangeListener listener)
      • List<String> getIndexes() throws CouchbaseLiteException
      • void createIndex(@NonNull String name, @NonNull Index index) throws CouchbaseLiteException
      • void createIndex(@NonNull String name, @NonNull IndexConfiguration config) throws CouchbaseLiteException
      • void deleteIndex(@NonNull String name) throws CouchbaseLiteException

      Swift

      • var count: UInt64
      • func document(withID id: String) -> Document?
      • func saveDocument(_ document: MutableDocument) throws
      • func saveDocument(_ document: MutableDocument, concurrencyControl: ConcurrencyControl) throws -> Bool
      • func saveDocument(_ document: MutableDocument, conflictHandler: @escaping (MutableDocument, Document?) -> Bool) throws -> Bool
      • func deleteDocument(_ document: Document) throws
      • public func deleteDocument( _ document: Document, concurrencyControl: ConcurrencyControl) throws -> Bool
      • func purgeDocument(_ document: Document) throws
      • func purgeDocument(withID documentID: String) throws
      • func setDocumentExpiration(withID documentID: String, expiration: Date?) throws
      • func getDocumentExpiration(withID documentID: String) -> Date?
      • func addChangeListener(_ listener: @escaping (DatabaseChange) -> Void) -> ListenerToken
      • func addChangeListener(withQueue queue: DispatchQueue?, listener: @escaping (DatabaseChange) -> Void) -> ListenerToken
      • func addDocumentChangeListener(withID id: String, listener: @escaping (DocumentChange) -> Void) -> ListenerToken
      • func addDocumentChangeListener(withID id: String, queue: DispatchQueue?, listener: @escaping (DocumentChange) -> Void) -> ListenerToken
      • var indexes: Array<String>
      • func createIndex(_ index: Index, withName name: String) throws
      • func createIndex(_ config: IndexConfiguration, name: String) throws
      • func deleteIndex(forName name: String) throws
      • subscript(key: String) -> DocumentFragment

      Objective-C

      • @property (readonly, atomic) uint64_t count
      • - (nullable CBLDocument*) documentWithID: (NSString*)id
      • - (BOOL) saveDocument: (CBLMutableDocument*)document error: (NSError**)error
      • - (BOOL) saveDocument: (CBLMutableDocument*)document concurrencyControl: (CBLConcurrencyControl)concurrencyControl error: (NSError**)error
      • - (BOOL) saveDocument: (CBLMutableDocument*)document conflictHandler: (BOOL (^)(CBLMutableDocument*, CBLDocument* nullable))conflictHandler error: (NSError**)error
      • - (BOOL) deleteDocument: (CBLDocument*)document error: (NSError**)error
      • - (BOOL) deleteDocument: (CBLDocument*)document concurrencyControl: (CBLConcurrencyControl)concurrencyControl error: (NSError{})error
      • - (BOOL) purgeDocument: (CBLDocument*)document error: (NSError**)error
      • - (BOOL) purgeDocumentWithID: (NSString*)documentID error: (NSError**)error
      • - (BOOL) setDocumentExpirationWithID: (NSString*)documentID expiration: (nullable NSDate*)date error: (NSError**)error
      • - (nullable NSDate*) getDocumentExpirationWithID: (NSString*)documentID
      • - (id<CBLListenerToken>) addChangeListener: (void (^)(CBLDatabaseChange*))listener
      • - (id<CBLListenerToken>) addChangeListenerWithQueue: (nullable dispatch_queue_t)queue listener: (void (^)(CBLDatabaseChange*))listener
      • - (id<CBLListenerToken>) addDocumentChangeListenerWithID: (NSString*)id listener: (void (^)(CBLDocumentChange*))listener
      • - (id<CBLListenerToken>) addDocumentChangeListenerWithID: (NSString*)id queue: (nullable dispatch_queue_t)queue listener: (void (^)(CBLDocumentChange*))listener
      • @property (atomic, readonly) NSArray<NSString*>* indexes
      • - (BOOL) createIndex: (CBLIndex*)index withName: (NSString*)name error: (NSError**)error
      • - (BOOL) createIndexWithConfig: (CBLIndexConfiguration*)config name: (NSString*)name error: (NSError**)error
      • - (BOOL) deleteIndexForName: (NSString*)name error: (NSError**)error
      • - (CBLDocumentFragment*) objectForKeyedSubscript: (NSString*)documentID

      .NET

      • ulong Count
      • Document GetDocument([@NotNull]string id)
      • void Save([@NotNull]MutableDocument document) => Save(document, ConcurrencyControl.LastWriteWins)
      • bool Save([@NotNull]MutableDocument document, ConcurrencyControl concurrencyControl)
      • bool Save([@NotNull]MutableDocument document, [@NotNull]Func<MutableDocument, Document, bool> conflictHandler)
      • void Delete([@NotNull]Document document)
      • bool Delete([@NotNull]Document document, ConcurrencyControl concurrencyControl)
      • void Purge([@NotNull]Document document)
      • void Purge([@NotNull]string docId)
      • bool SetDocumentExpiration(string docId, DateTimeOffset? expiration)
      • DateTimeOffset? GetDocumentExpiration(string docId)
      • ListenerToken AddChangeListener([@CanBeNull] TaskScheduler scheduler, [@NotNull] EventHandler<DatabaseChangedEventArgs> handler)
      • ListenerToken AddChangeListener([@NotNull] EventHandler<DatabaseChangedEventArgs> handler) => AddChangeListener(null, handler)
      • ListenerToken AddDocumentChangeListener([@NotNull] string id, [@CanBeNull] TaskScheduler scheduler, [@NotNull] EventHandler<DocumentChangedEventArgs> handler)
      • ListenerToken AddDocumentChangeListener([@NotNull] string id, [@NotNull] EventHandler<DocumentChangedEventArgs> handler) => AddDocumentChangeListener(id, null, handler);
      • IList<string> GetIndexes()
      • void CreateIndex([@NotNull]string name, [@NotNull]IIndex index)
      • void CreateIndex([@NotNull] string name, [@NotNull] IndexConfiguration indexConfig)
      • void DeleteIndex([@NotNull]string name)

      C

      • uint64_t CBLDatabase_Count(const CBLDatabase*)
      • const CBLDocument* _cbl_nullable CBLDatabase_GetDocument(const CBLDatabase* database, FLString docID, CBLError* _cbl_nullable outError)
      • CBLDocument* _cbl_nullable CBLDatabase_GetMutableDocument(CBLDatabase* database, FLString docID, CBLError* _cbl_nullable outError)
      • bool CBLDatabase_SaveDocument(CBLDatabase* db, CBLDocument* doc, CBLError* _cbl_nullable outError)
      • bool CBLDatabase_SaveDocumentWithConcurrencyControl(CBLDatabase* db, CBLDocument* doc, CBLConcurrencyControl concurrency, CBLError* _cbl_nullable outError)
      • bool CBLDatabase_SaveDocumentWithConflictHandler(CBLDatabase* db, CBLDocument* doc, CBLConflictHandler conflictHandler, void* _cbl_nullable context, CBLError* _cbl_nullable outError)
      • bool CBLDatabase_DeleteDocument(CBLDatabase* db, const CBLDocument document, CBLError* _cbl_nullable outError)
      • bool CBLDatabase_DeleteDocumentWithConcurrencyControl(CBLDatabase* db, const CBLDocument* document, CBLConcurrencyControl concurrency, CBLError* _cbl_nullable outError)
      • bool CBLDatabase_PurgeDocument(CBLDatabase* db, const CBLDocument* document, CBLError* _cbl_nullable outError)
      • bool CBLDatabase_PurgeDocumentByID(CBLDatabase* database, FLString docID, CBLError* _cbl_nullable outError)
      • CBLTimestamp CBLDatabase_GetDocumentExpiration(CBLDatabase* db, FLSlice docID, CBLError* _cbl_nullable outError)
      • bool CBLDatabase_SetDocumentExpiration(CBLDatabase* db, FLSlice docID, CBLTimestamp expiration, CBLError* _cbl_nullable outError)
      • CBLListenerToken* CBLDatabase_AddChangeListener(const CBLDatabase* db, CBLDatabaseChangeListener listener, void* _cbl_nullable context)
      • CBLListenerToken* CBLDatabase_AddDocumentChangeListener(const CBLDatabase* db, FLString docID, CBLDocumentChangeListener listener, void* _cbl_nullable context)
      • FLArray CBLDatabase_GetIndexNames(CBLDatabase* db)
      • bool CBLDatabase_CreateValueIndex(CBLDatabase* db, FLString name, CBLValueIndexConfiguration config, CBLError* _cbl_nullable outError) CBLAPI
      • bool CBLDatabase_CreateFullTextIndex(CBLDatabase* db, FLString name, CBLFullTextIndexConfiguration config, CBLError* _cbl_nullable outError)
      • bool CBLDatabase_DeleteIndex(CBLDatabase* db, FLString name, CBLError* _cbl_nullable outError)

       

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            The Lite The Lite
            pasin Pasin Suriyentrakorn
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty