def collection(parent = nil)
      parent ? parent.collection.with(client_options) : client[collection_name.to_sym]
    end
def collection(parent = nil)
      parent ? parent.collection.with(client_options) : client[collection_name.to_sym]
    end
Initialize the persistence context object.

 @example Create a new persistence context.
   PersistenceContext.new(model, collection: 'other')

 @param [ Object ] object The class or model instance for which a persistence context
   should be created.
 @param [ Hash ] opts The persistence context options.

 @since 6.0.0
 Get the collection for this persistence context.

 @example Get the collection for this persistence context.
   context.collection

 @param [ Object ] parent The parent object whose collection name is used
   instead of this persistence context's collection name.

 @return [ Mongo::Collection ] The collection for this persistence
   context.

 @since 6.0.0