diff --git a/classes/Classes.CollectionAccessor.html b/classes/Classes.CollectionAccessor.html index 7d670c9..1a022b2 100644 --- a/classes/Classes.CollectionAccessor.html +++ b/classes/Classes.CollectionAccessor.html @@ -1,19 +1,19 @@ -CollectionAccessor | SuperCamo - v0.4.5

Class CollectionAccessor

The data structure used by NedbClients to manage their collections of documents.

+CollectionAccessor | SuperCamo - v1.0.0

Class CollectionAccessor

The data structure used by NedbClients to manage their collections of documents.

The path and datastore are used in the actual persisting of the data by NeDB.

The name and model are used by SuperCamo to determine what document rules to apply to the collection's data.

This is not a class that you, as a user of the SuperCamo package, will typically interact with or use directly at all.

BigfootDS

-

Implements

Constructors

Implements

Constructors

Properties

Constructors

Properties

datastore: Nedb<Record<string, any>>

Reference to the NeDB Datastore object for this collection.

+

Constructors

Properties

datastore: Nedb<Record<string, any>>

Reference to the NeDB Datastore object for this collection.

BigfootDS

-
model: typeof NedbDocument

Reference to the NedbDocument-inheriting class used to define the collection's data structure.

+
model: typeof NedbDocument

Reference to the NedbDocument-inheriting class used to define the collection's data structure.

BigfootDS

-
name: string

Name of the collection.

+
name: string

Name of the collection.

BigfootDS

-
path: string

Path to its ".db" NeDB file.

+
path: string

Path to its ".db" NeDB file.

BigfootDS

-
+
diff --git a/classes/Classes.CollectionListEntry.html b/classes/Classes.CollectionListEntry.html index 0238311..21801c3 100644 --- a/classes/Classes.CollectionListEntry.html +++ b/classes/Classes.CollectionListEntry.html @@ -1,14 +1,14 @@ -CollectionListEntry | SuperCamo - v0.4.5

Class CollectionListEntry

The data structure used by NedbClients to initialise a collection when setting up a database connection.

+CollectionListEntry | SuperCamo - v1.0.0

Class CollectionListEntry

The data structure used by NedbClients to initialise a collection when setting up a database connection.

You, as a user of the SuperCamo package, will typically use this class when first connecting to a database - and no other times.

let newClient = SuperCamo.clientConnect(
"ExampleDatabase",
"./ExampleDatabase/",
[
new CollectionListEntry("Users", User),
]
);

BigfootDS

-

Implements

Constructors

Implements

Constructors

Properties

Constructors

Properties

model: typeof NedbDocument

Reference to the NedbDocument-inheriting class used to define the collection's data structure.

+

Constructors

Properties

model: typeof NedbDocument

Reference to the NedbDocument-inheriting class used to define the collection's data structure.

BigfootDS

-
name: string

Name of the collection.

+
name: string

Name of the collection.

BigfootDS

-
+
diff --git a/classes/Classes.NedbBaseDocument.html b/classes/Classes.NedbBaseDocument.html index 25dcbc4..141a6a6 100644 --- a/classes/Classes.NedbBaseDocument.html +++ b/classes/Classes.NedbBaseDocument.html @@ -1,4 +1,4 @@ -NedbBaseDocument | SuperCamo - v0.4.5

Class NedbBaseDocumentAbstract

Hierarchy (view full)

Implements

Constructors

constructor +NedbBaseDocument | SuperCamo - v1.0.0

Class NedbBaseDocumentAbstract

Hierarchy (view full)

Implements

Constructors

Properties

Accessors

collectionName data @@ -19,59 +19,59 @@ create

Constructors

Properties

rules: {
    [key: string]: DocumentKeyRule;
}

Define your document's properties in here!

+

Properties

rules: {
    [key: string]: DocumentKeyRule;
}

Define your document's properties in here!

BigfootDS

-

Accessors

Accessors

  • get collectionName(): null | string
  • Read-only string containing the name of the database collection that this document instance comes from.

    If this is null, assume that this document instance does not represent any data stored in a database.

    Returns null | string

    BigfootDS

    -

Methods

Methods

  • Delete this document from the database client that it lives in.

    If you're using a databaseless-document instance, this method will throw an error!

    Parameters

    • OptionaldeleteReferences: boolean

      Similar to deepDeleteReferences, but you can pick one or the other. If true, all referenced documents will also delete themselves. If those referenced documents also reference additional documents, those documents are unaffected and may become orphaned.

    • OptionaldeepDeleteReferences: boolean

      Similar to deleteReferences, but you can pick one or the other. If true, all referenced documents will also delete themselves and recursively delete any documents that they also reference.

    Returns Promise<number>

    Number of documents deleted. You'd want this to be just 1. Other functions may use this number to create a greater tally (eg. a database client's findAndDeleteMany method).

    BigfootDS

    -
  • An asynchronous function or promise that runs whenever delete() is executed. Override this and customise it if you'd like!

    Returns Promise<void>

    BigfootDS

    -
  • An asynchronous function or promise that runs whenever save() is executed. Override this and customise it if you'd like!

    Returns Promise<void>

    BigfootDS

    -
  • An asynchronous function or promise that runs whenever validate() is executed. Override this and customise it if you'd like!

    Returns Promise<void>

    BigfootDS

    -
  • An asynchronous function or promise that runs whenever delete() is executed. Override this and customise it if you'd like!

    Returns Promise<void>

    BigfootDS

    -
  • An asynchronous function or promise that runs whenever save() is executed. Override this and customise it if you'd like!

    Returns Promise<void>

    BigfootDS

    -
  • An asynchronous function or promise that runs whenever validate() is executed. Override this and customise it if you'd like!

    Returns Promise<void>

    BigfootDS

    -
  • Save the document to the database. If the document doesn't already exist in the database, it will be added to the database automatically.

    This function also runs any preSave and postSave methods defined on the document.

    Returns Promise<boolean>

    BigfootDS

    -
  • This document instance's data, and only the data, organized onto an object.

    This does not retrieve any referenced document's data, it's just a shallow object representation of this own document!

    Returns object

    Object containing data from the document instance.

    BigfootDS

    -
  • Run validation logic against the rules defined in the document's rules property.

    This function also runs any preValidate and postValidate methods defined on the document.

    Returns Promise<boolean>

    BigfootDS

    -
  • Create an instance of the document's type. This does not write any data to a database.

    Type Parameters

    Parameters

    • this: (new (incomingData: object, incomingParentDatabaseName: string, incomingCollectionName: string) => Type)
        • new (incomingData, incomingParentDatabaseName, incomingCollectionName): Type
        • Parameters

          • incomingData: object
          • incomingParentDatabaseName: string
          • incomingCollectionName: string

          Returns Type

    • newData: object

      Object containing keys of data that the document requires per its schema.

    • newParentDatabaseName: string

      The name of the database/client that is managing this data.

    • newCollectionName: string

      The name of the collection that is using this document as a model for its data.

    • OptionalvalidateOnCreate: boolean = true

      Boolean flag for whether or not a document instance created with this method should be validated ASAP. Default is true.

    Returns Promise<Type>

    BigfootDS

    -
+
diff --git a/classes/Classes.NedbClient.html b/classes/Classes.NedbClient.html index 7f76660..e901f5b 100644 --- a/classes/Classes.NedbClient.html +++ b/classes/Classes.NedbClient.html @@ -1,4 +1,4 @@ -NedbClient | SuperCamo - v0.4.5

Implements

Constructors

constructor +NedbClient | SuperCamo - v1.0.0

Implements

Constructors

Properties

  • dbDirectoryPath: string

    The folder path for where the database and its collections will be stored.

  • collectionsList: CollectionListEntry[]

    An array of collections, where each item in this array is an object containing the name of the collection and the model or document that the collection will use.

  • Returns NedbClient

    BigfootDS

    -

    Properties

    collections: CollectionAccessor[] = []

    A list of meta-objects defining categories of documents in the database.

    +

    Properties

    collections: CollectionAccessor[] = []

    A list of meta-objects defining categories of documents in the database.

    A collection is an object containing a collection name, document type, plus other properties to help access that data. This means that multiple collections could use the same document type while still keeping database records in separate collections in the database.

    BigfootDS

    -
    documents: typeof NedbDocument[] = []

    The set of document types used in this database.

    +
    documents: typeof NedbDocument[] = []

    The set of document types used in this database.

    This is calculated based on the collections that the database is configured to use, since multiple collections could use the same document type.

    BigfootDS

    -
    embeddedDocuments: typeof NedbEmbeddedDocument[] = []

    The set of embedded-document types used in this database.

    +
    embeddedDocuments: typeof NedbEmbeddedDocument[] = []

    The set of embedded-document types used in this database.

    This is calculated based on the collections that the database is configured to use, since multiple collections could use the same embedded-document type.

    BigfootDS

    -
    name: string = ""

    The name of the database.

    +
    name: string = ""

    The name of the database.

    BigfootDS

    -
    path: string = ""

    The database's folder path, where it stores all collections.

    +
    path: string = ""

    The database's folder path, where it stores all collections.

    BigfootDS

    -

    Methods

    Methods

    • Query a collection and receive a number representing the count of documents matching that query.

      Parameters

      • collectionName: string

        The name of the collection that you wish search through.

      • query: object

        The NeDB query used to find the specific document within the collection.

      Returns Promise<number>

      Integer number of documents within the specified collection that match the query.

      BigfootDS

      -
    • Configure an enforced constraint on a collection.

      See the @seald/nedb documentation for more info about NeDB indexes.

      Parameters

      • collectionName: string

        A string of the collection name to target within the database.

      • indexOptions: EnsureIndexOptions

        An object per the @seald/nedb documentation to configure the index that is to be created.

      Returns Promise<void>

      Promise.

      BigfootDS

      -
    • Create multiple document instances from a provided array of object data, insert each document instance into the database, and return the array of document instances.

      +
    • Create multiple document instances from a provided array of object data, insert each document instance into the database, and return the array of document instances.

      Parameters

      • collectionName: string
      • dataObjectArray: object[]

      Returns Promise<NedbDocument[]>

      BigfootDS

      -
    • Create a document instance from a provided object of data, insert the new document instance into the database, and return the new document instance.

      +
    • Create a document instance from a provided object of data, insert the new document instance into the database, and return the new document instance.

      Parameters

      • collectionName: string
      • dataObject: object

      Returns Promise<NedbDocument>

      BigfootDS

      -
    • Delete collections by model. Can delete multiple collections that use the same model.

      You can also specify whether or not the data within the collection should be deleted, just as a sanity-check. This is enabled by default.

      Parameters

      • model: typeof NedbDocument

        The model to search for.

      • OptionaldeleteData: boolean = true

        Whether or not data within the collection should be deleted. Defaults to true.

      Returns Promise<number>

      The number of collections with a matching name that were deleted.

      BigfootDS

      -
    • Delete collections by name. Can delete multiple collections that use the same name.

      You can also specify whether or not the data within the collection should be deleted, just as a sanity-check. This is enabled by default.

      Parameters

      • name: string

        The name of the collections to search for.

      • OptionaldeleteData: boolean = true

        Whether or not data within the collection should be deleted. Defaults to true.

      Returns Promise<number>

      The number of collections with a matching name that were deleted.

      BigfootDS

      -
    • Delete all documents in all collections within this database. Highly destructive. Could use more work.

      Returns Promise<void>

      BigfootDS

      -
    • Find and delete multiple documents from a specified collection.

      Parameters

      • collectionName: string

        The name of the collection that you wish to search through and modify.

      • query: object

        The NeDB query used to find the specific documents within the collection.

      • options: RemoveOptions = ...

        Options to pass to the query system in NeDB. For this particular method, multi is always set to true.

      Returns Promise<number>

      Number of removed documents.

      BigfootDS

      -
    • Find and delete one document from a specified collection.

      Parameters

      • collectionName: string

        The name of the collection that you wish to search through and modify.

      • query: object

        The NeDB query used to find the specific document within the collection.

      • options: RemoveOptions = ...

        Options to pass to the query system in NeDB. For this particular method, multi is always set to false.

      Returns Promise<number>

      Number of removed documents.

      BigfootDS

      -
    • Search a database for one or more matched documents and modify them, returning the modified documents as an array of document instances.

      +
    • Search a database for one or more matched documents and modify them, returning the modified documents as an array of document instances.

      If no documents match the given query, this function will return an empty array.

      Parameters

      • collectionName: string

        The name of the database collection to query.

      • query: object

        The query to run to find the relevant document.

      • newData: object

        The data to apply to the found document.

      • Optionaloptions: updateManyOptions

        Optional. The options that can be used in this operation.

      Returns Promise<NedbDocument[]>

      BigfootDS

      -
    • Search a database for one or more matched documents and modify them, returning the modified documents as an array of plain objects.

      +
    • Search a database for one or more matched documents and modify them, returning the modified documents as an array of plain objects.

      If no documents match the given query, this function will return an empty array.

      Parameters

      • collectionName: string

        The name of the database collection to query.

      • query: object

        The query to run to find the relevant document.

      • newData: object

        The data to apply to the found document.

      • Optionaloptions: updateManyOptions

        Optional. The options that can be used in this operation.

      Returns Promise<object[]>

      BigfootDS

      -
    • Search a database for a singular matched document and modify it, returning the modified document as a document instance.

      +
    • Search a database for a singular matched document and modify it, returning the modified document as a document instance.

      Parameters

      • collectionName: string

        The name of the database collection to query.

      • query: object

        The query to run to find the relevant document.

      • newData: object

        The data to apply to the found document.

      • Optionaloptions: updateOptions

        Optional. The options that can be used in this operation.

      Returns Promise<null | NedbDocument>

      BigfootDS

      -
    • Search a database for a singular matched document and modify it, returning the modified document as a plain object.

      +
    • Search a database for a singular matched document and modify it, returning the modified document as a plain object.

      Parameters

      • collectionName: string

        The name of the database collection to query.

      • query: object

        The query to run to find the relevant document.

      • newData: object

        The data to apply to the found document.

      • Optionaloptions: updateOptions

        Optional. The options that can be used in this operation.

      Returns Promise<null | object>

      BigfootDS

      -
    • Query a collection and return an array of document instances matching that query.

      This method is NOT compatible with NeDB projections.

      Even if nothing matches the given query, an array is returned.

      Parameters

      • collectionName: string

        The name of the collection that you wish to search through.

        @@ -122,7 +122,7 @@
      • Optionaloptions: findManyDocumentsOptions

        Optional. Configuration for this database operation.

      Returns Promise<NedbDocument[]>

      An instance of the collection's model.

      BigfootDS

      -
    • Query a collection and return an array of objects matching that query, where each object is a document's data.

      +
    • Query a collection and return an array of objects matching that query, where each object is a document's data.

      This method is compatible with NeDB projections, allowing you to trim the returned data. Read more in the NeDB documentation.

      Even if nothing matches the given query, an array is returned.

      Parameters

      • collectionName: string

        The name of the collection that you wish to search through.

        @@ -130,36 +130,36 @@
      • Optionaloptions: findManyObjectsOptions

        Optional. Configuration for this database operation.

      Returns Promise<object[]>

      An instance of the collection's model.

      BigfootDS

      -
    • Query a collection and receive the first document matching that query, returned as a document instance.

      This method is NOT compatible with NeDB projections, and thus returns an instance of the document used by the specified collection.

      Parameters

      Returns Promise<null | NedbDocument>

      An instance of the collection's model.

      BigfootDS

      -
    • Query a collection and receive the first document matching that query, returned as a plain object.

      +
    • Query a collection and receive the first document matching that query, returned as a plain object.

      This method is compatible with NeDB projections, allowing you to trim the returned data. Read more in the NeDB documentation.

      Parameters

      Returns Promise<null | object>

      An instance of the collection's model.

      BigfootDS

      -
    • Retrieve the collection meta object stored on the NeDB client instance matching a given collection name.

      Parameters

      • collectionName: string

        A string of the collection name to target within the database.

      Returns CollectionAccessor

      An object containing helper properties to perform collection-related operations.

      BigfootDS

      -
    • Insert an array of objects of data into the database, following a document schema, and return the saved array of objects of data.

      +
    • Insert an array of objects of data into the database, following a document schema, and return the saved array of objects of data.

      Parameters

      • collectionName: string

        The name of the collection to insert the data into.

      • dataObjectArray: object[]

        The data to be inserted.

      Returns Promise<object[]>

      The data saved in the database, as an object.

      BigfootDS

      -
    • Insert an object of data into the database, following a document schema, and return the saved object of data.

      +
    • Insert an object of data into the database, following a document schema, and return the saved object of data.

      Parameters

      • collectionName: string

        The name of the collection to insert the data into.

      • dataObject: object

        The data to be inserted.

      Returns Promise<object>

      The data saved in the database, as an object.

      BigfootDS

      -
    • Remove a collection's index from an array of given field names.

      Parameters

      • collectionName: string

        A string of the collection name to target within the database.

      • fieldNames: string[]

        An array containing one or more fields on the collection that you'd like to remove the index from.

      Returns Promise<void>

      Promise.

      BigfootDS

      -
    +
    diff --git a/classes/Classes.NedbDocument.html b/classes/Classes.NedbDocument.html index b6a5364..b0385b4 100644 --- a/classes/Classes.NedbDocument.html +++ b/classes/Classes.NedbDocument.html @@ -1,4 +1,4 @@ -NedbDocument | SuperCamo - v0.4.5

    Hierarchy (view full)

    Constructors

    constructor +NedbDocument | SuperCamo - v1.0.0

    Hierarchy (view full)

    Constructors

    Properties

    Accessors

    Constructors

    Properties

    rules: {
        [key: string]: DocumentKeyRule;
    }

    Define your document's properties in here!

    +

    Constructors

    Properties

    rules: {
        [key: string]: DocumentKeyRule;
    }

    Define your document's properties in here!

    BigfootDS

    -

    Accessors

    Accessors

    • get collectionName(): null | string
    • Read-only string containing the name of the database collection that this document instance comes from.

      If this is null, assume that this document instance does not represent any data stored in a database.

      Returns null | string

      BigfootDS

      -
    • get parentDatabaseName(): null | string
    • Read-only string containing the name of the database that this document instance comes from.

      If this is null, assume that this document instance does not represent any data stored in a database.

      Returns null | string

      BigfootDS

      -

    Methods

    • Delete this document from the database client that it lives in.

      +

    Methods

    • Delete this document from the database client that it lives in.

      If you're using a databaseless-document instance, this method will throw an error!

      Parameters

      • OptionaldeleteReferences: boolean

        Similar to deepDeleteReferences, but you can pick one or the other. If true, all referenced documents will also delete themselves. If those referenced documents also reference additional documents, those documents are unaffected and may become orphaned.

      • OptionaldeepDeleteReferences: boolean

        Similar to deleteReferences, but you can pick one or the other. If true, all referenced documents will also delete themselves and recursively delete any documents that they also reference.

      Returns Promise<number>

      Number of documents deleted. You'd want this to be just 1. Other functions may use this number to create a greater tally (eg. a database client's findAndDeleteMany method).

      BigfootDS

      -
    • Save the document to the database. If the document doesn't already exist in the database, it will be added to the database automatically.

      This function also runs any preSave and postSave methods defined on the document.

      Returns Promise<boolean>

      BigfootDS

      -
    • This document instance's data, and only the data, organized onto an object.

      This does not retrieve any referenced document's data, it's just a shallow object representation of this own document!

      Returns object

      Object containing data from the document instance.

      BigfootDS

      -
    • Create an instance of the document's type. This does not write any data to a database.

      Type Parameters

      Parameters

      • this: (new (incomingData: object, incomingParentDatabaseName: string, incomingCollectionName: string) => Type)
          • new (incomingData, incomingParentDatabaseName, incomingCollectionName): Type
          • Parameters

            • incomingData: object
            • incomingParentDatabaseName: string
            • incomingCollectionName: string

            Returns Type

      • newData: object

        Object containing keys of data that the document requires per its schema.

      • newParentDatabaseName: string

        The name of the database/client that is managing this data.

      • newCollectionName: string

        The name of the collection that is using this document as a model for its data.

      • OptionalvalidateOnCreate: boolean = true

        Boolean flag for whether or not a document instance created with this method should be validated ASAP. Default is true.

      Returns Promise<Type>

      BigfootDS

      -
    +
    diff --git a/classes/Classes.NedbEmbeddedDocument.html b/classes/Classes.NedbEmbeddedDocument.html index 739d54e..81a2838 100644 --- a/classes/Classes.NedbEmbeddedDocument.html +++ b/classes/Classes.NedbEmbeddedDocument.html @@ -1,4 +1,4 @@ -NedbEmbeddedDocument | SuperCamo - v0.4.5

    Class NedbEmbeddedDocument

    Hierarchy (view full)

    Constructors

    constructor +NedbEmbeddedDocument | SuperCamo - v1.0.0

    Class NedbEmbeddedDocument

    Hierarchy (view full)

    Constructors

    Properties

    Accessors

    Constructors

    Properties

    rules: {
        [key: string]: DocumentKeyRule;
    }

    Define your document's properties in here!

    +

    Constructors

    Properties

    rules: {
        [key: string]: DocumentKeyRule;
    }

    Define your document's properties in here!

    BigfootDS

    -

    Accessors

    Accessors

    • get collectionName(): null | string
    • Read-only string containing the name of the database collection that this document instance comes from.

      If this is null, assume that this document instance does not represent any data stored in a database.

      Returns null | string

      BigfootDS

      -
    • get parentDatabaseName(): null | string
    • Read-only string containing the name of the database that this document instance comes from.

      If this is null, assume that this document instance does not represent any data stored in a database.

      Returns null | string

      BigfootDS

      -

    Methods

    • Delete this document from the database client that it lives in.

      +

    Methods

    • Delete this document from the database client that it lives in.

      If you're using a databaseless-document instance, this method will throw an error!

      Parameters

      • OptionaldeleteReferences: boolean

        Similar to deepDeleteReferences, but you can pick one or the other. If true, all referenced documents will also delete themselves. If those referenced documents also reference additional documents, those documents are unaffected and may become orphaned.

      • OptionaldeepDeleteReferences: boolean

        Similar to deleteReferences, but you can pick one or the other. If true, all referenced documents will also delete themselves and recursively delete any documents that they also reference.

      Returns Promise<number>

      Number of documents deleted. You'd want this to be just 1. Other functions may use this number to create a greater tally (eg. a database client's findAndDeleteMany method).

      BigfootDS

      -
    • Save the document to the database. If the document doesn't already exist in the database, it will be added to the database automatically.

      This function also runs any preSave and postSave methods defined on the document.

      Returns Promise<boolean>

      BigfootDS

      -
    • This document instance's data, and only the data, organized onto an object.

      This does not retrieve any referenced document's data, it's just a shallow object representation of this own document!

      Returns object

      Object containing data from the document instance.

      BigfootDS

      -
    • Create an instance of the document's type. This does not write any data to a database.

      Type Parameters

      Parameters

      • this: (new (incomingData: object, incomingParentDatabaseName: string, incomingCollectionName: string) => Type)
          • new (incomingData, incomingParentDatabaseName, incomingCollectionName): Type
          • Parameters

            • incomingData: object
            • incomingParentDatabaseName: string
            • incomingCollectionName: string

            Returns Type

      • newData: object

        Object containing keys of data that the document requires per its schema.

      • newParentDatabaseName: string

        The name of the database/client that is managing this data.

      • newCollectionName: string

        The name of the collection that is using this document as a model for its data.

      • OptionalvalidateOnCreate: boolean = true

        Boolean flag for whether or not a document instance created with this method should be validated ASAP. Default is true.

      Returns Promise<Type>

      BigfootDS

      -
    +
    diff --git a/classes/Classes.SuperCamo.html b/classes/Classes.SuperCamo.html index efa8109..b611e94 100644 --- a/classes/Classes.SuperCamo.html +++ b/classes/Classes.SuperCamo.html @@ -1,4 +1,4 @@ -SuperCamo | SuperCamo - v0.4.5

    Properties

    clients +SuperCamo | SuperCamo - v1.0.0

    Properties

    Accessors

    Methods

    clientConnect clientDelete @@ -9,25 +9,25 @@
    	let pokemonDatabase = SuperCamo.clientConnect(
    "Pokemon Database",
    "./Storage",
    [
    new CollectionListEntry("Users", User),
    new CollectionListEntry("CapturedPokemon", Pokemon),
    new CollectionListEntry("WildPokemon", Pokemon)
    ]
    );
    -

    Accessors

    Accessors

    Methods

    Methods

    • Create a database client instance, connecting to it and returning its instance.

      Parameters

      • databaseName: string

        A unique name for the database.

      • OptionaldatabaseDirectory: string = ""

        The folder path for where the database and its collections will be stored.

      • OptionalcollectionsList: CollectionsListEntry[] = []

        An array of collections, where each item in this array is an object containing the name of the collection and the model or document that the collection will use.

      • OptionalclientType: typeof NedbClient = NedbClient

        A custom type of database client, though you can leave this blank to use the default SuperCamo database client.

      Returns NedbClient

      The newly-created database client instance.

      BigfootDS

      -
    • Disconnect from the specified database AND delete its files. This is extremely destructive! Be careful!

      Parameters

      • targetClient: string

        The name of the database that you wish to disconnect from.

      Returns number

      Number of clients disconnected.

      BigfootDS

      -
    • Disconnect from the specified database.

      Parameters

      • targetClient: string

        The name of the database that you wish to disconnect from.

      Returns number

      Number of clients disconnected.

      BigfootDS

      -
    • Create an accessor for a database that is connected in the app.

      Parameters

      • targetClient: string

        The name of the database that you wish to connect to.

      Returns null | NedbClient

      A NedbClient instance.

      BigfootDS

      -
    +
    diff --git a/classes/Error_Classes.CollectionAccessError.html b/classes/Error_Classes.CollectionAccessError.html index 26211c7..06c409f 100644 --- a/classes/Error_Classes.CollectionAccessError.html +++ b/classes/Error_Classes.CollectionAccessError.html @@ -1,11 +1,11 @@ -CollectionAccessError | SuperCamo - v0.4.5

    Hierarchy

    • Error
      • CollectionAccessError

    Constructors

    constructor +CollectionAccessError | SuperCamo - v1.0.0

    Hierarchy

    • Error
      • CollectionAccessError

    Constructors

    Properties

    message: string
    name: string
    stack?: string
    prepareStackTrace?: ((err: Error, stackTraces: CallSite[]) => any)

    Optional override for formatting stack traces

    +

    Constructors

    Properties

    message: string
    name: string
    stack?: string
    prepareStackTrace?: ((err: Error, stackTraces: CallSite[]) => any)

    Optional override for formatting stack traces

    stackTraceLimit: number

    Methods

    • Create .stack property on a target object

      -

      Parameters

      • targetObject: object
      • OptionalconstructorOpt: Function

      Returns void

    +

    Parameters

    Returns void

    diff --git a/classes/Error_Classes.DeleteFailure.html b/classes/Error_Classes.DeleteFailure.html index 418122d..6ecd00c 100644 --- a/classes/Error_Classes.DeleteFailure.html +++ b/classes/Error_Classes.DeleteFailure.html @@ -1,11 +1,11 @@ -DeleteFailure | SuperCamo - v0.4.5

    Hierarchy

    • Error
      • DeleteFailure

    Constructors

    constructor +DeleteFailure | SuperCamo - v1.0.0

    Hierarchy

    • Error
      • DeleteFailure

    Constructors

    Properties

    message: string
    name: string
    stack?: string
    prepareStackTrace?: ((err: Error, stackTraces: CallSite[]) => any)

    Optional override for formatting stack traces

    +

    Constructors

    Properties

    message: string
    name: string
    stack?: string
    prepareStackTrace?: ((err: Error, stackTraces: CallSite[]) => any)

    Optional override for formatting stack traces

    stackTraceLimit: number

    Methods

    • Create .stack property on a target object

      -

      Parameters

      • targetObject: object
      • OptionalconstructorOpt: Function

      Returns void

    +

    Parameters

    Returns void

    diff --git a/classes/Error_Classes.PostDeleteFailure.html b/classes/Error_Classes.PostDeleteFailure.html index c238d01..d7e6685 100644 --- a/classes/Error_Classes.PostDeleteFailure.html +++ b/classes/Error_Classes.PostDeleteFailure.html @@ -1,11 +1,11 @@ -PostDeleteFailure | SuperCamo - v0.4.5

    Hierarchy

    • Error
      • PostDeleteFailure

    Constructors

    constructor +PostDeleteFailure | SuperCamo - v1.0.0

    Hierarchy

    • Error
      • PostDeleteFailure

    Constructors

    Properties

    message: string
    name: string
    stack?: string
    prepareStackTrace?: ((err: Error, stackTraces: CallSite[]) => any)

    Optional override for formatting stack traces

    +

    Constructors

    Properties

    message: string
    name: string
    stack?: string
    prepareStackTrace?: ((err: Error, stackTraces: CallSite[]) => any)

    Optional override for formatting stack traces

    stackTraceLimit: number

    Methods

    • Create .stack property on a target object

      -

      Parameters

      • targetObject: object
      • OptionalconstructorOpt: Function

      Returns void

    +

    Parameters

    Returns void

    diff --git a/classes/Error_Classes.PostSaveFailure.html b/classes/Error_Classes.PostSaveFailure.html index 82851e4..4841ce4 100644 --- a/classes/Error_Classes.PostSaveFailure.html +++ b/classes/Error_Classes.PostSaveFailure.html @@ -1,11 +1,11 @@ -PostSaveFailure | SuperCamo - v0.4.5

    Hierarchy

    • Error
      • PostSaveFailure

    Constructors

    constructor +PostSaveFailure | SuperCamo - v1.0.0

    Hierarchy

    • Error
      • PostSaveFailure

    Constructors

    Properties

    message: string
    name: string
    stack?: string
    prepareStackTrace?: ((err: Error, stackTraces: CallSite[]) => any)

    Optional override for formatting stack traces

    +

    Constructors

    Properties

    message: string
    name: string
    stack?: string
    prepareStackTrace?: ((err: Error, stackTraces: CallSite[]) => any)

    Optional override for formatting stack traces

    stackTraceLimit: number

    Methods

    • Create .stack property on a target object

      -

      Parameters

      • targetObject: object
      • OptionalconstructorOpt: Function

      Returns void

    +

    Parameters

    Returns void

    diff --git a/classes/Error_Classes.PostValidationFailure.html b/classes/Error_Classes.PostValidationFailure.html index d491cc3..6caeadf 100644 --- a/classes/Error_Classes.PostValidationFailure.html +++ b/classes/Error_Classes.PostValidationFailure.html @@ -1,11 +1,11 @@ -PostValidationFailure | SuperCamo - v0.4.5

    Hierarchy

    • Error
      • PostValidationFailure

    Constructors

    constructor +PostValidationFailure | SuperCamo - v1.0.0

    Hierarchy

    • Error
      • PostValidationFailure

    Constructors

    Properties

    message: string
    name: string
    stack?: string
    prepareStackTrace?: ((err: Error, stackTraces: CallSite[]) => any)

    Optional override for formatting stack traces

    +

    Constructors

    Properties

    message: string
    name: string
    stack?: string
    prepareStackTrace?: ((err: Error, stackTraces: CallSite[]) => any)

    Optional override for formatting stack traces

    stackTraceLimit: number

    Methods

    • Create .stack property on a target object

      -

      Parameters

      • targetObject: object
      • OptionalconstructorOpt: Function

      Returns void

    +

    Parameters

    Returns void

    diff --git a/classes/Error_Classes.PreDeleteFailure.html b/classes/Error_Classes.PreDeleteFailure.html index b4683d9..d68a343 100644 --- a/classes/Error_Classes.PreDeleteFailure.html +++ b/classes/Error_Classes.PreDeleteFailure.html @@ -1,11 +1,11 @@ -PreDeleteFailure | SuperCamo - v0.4.5

    Hierarchy

    • Error
      • PreDeleteFailure

    Constructors

    constructor +PreDeleteFailure | SuperCamo - v1.0.0

    Hierarchy

    • Error
      • PreDeleteFailure

    Constructors

    Properties

    message: string
    name: string
    stack?: string
    prepareStackTrace?: ((err: Error, stackTraces: CallSite[]) => any)

    Optional override for formatting stack traces

    +

    Constructors

    Properties

    message: string
    name: string
    stack?: string
    prepareStackTrace?: ((err: Error, stackTraces: CallSite[]) => any)

    Optional override for formatting stack traces

    stackTraceLimit: number

    Methods

    • Create .stack property on a target object

      -

      Parameters

      • targetObject: object
      • OptionalconstructorOpt: Function

      Returns void

    +

    Parameters

    Returns void

    diff --git a/classes/Error_Classes.PreSaveFailure.html b/classes/Error_Classes.PreSaveFailure.html index b627b48..435185a 100644 --- a/classes/Error_Classes.PreSaveFailure.html +++ b/classes/Error_Classes.PreSaveFailure.html @@ -1,11 +1,11 @@ -PreSaveFailure | SuperCamo - v0.4.5

    Hierarchy

    • Error
      • PreSaveFailure

    Constructors

    constructor +PreSaveFailure | SuperCamo - v1.0.0

    Hierarchy

    • Error
      • PreSaveFailure

    Constructors

    Properties

    message: string
    name: string
    stack?: string
    prepareStackTrace?: ((err: Error, stackTraces: CallSite[]) => any)

    Optional override for formatting stack traces

    +

    Constructors

    Properties

    message: string
    name: string
    stack?: string
    prepareStackTrace?: ((err: Error, stackTraces: CallSite[]) => any)

    Optional override for formatting stack traces

    stackTraceLimit: number

    Methods

    • Create .stack property on a target object

      -

      Parameters

      • targetObject: object
      • OptionalconstructorOpt: Function

      Returns void

    +

    Parameters

    Returns void

    diff --git a/classes/Error_Classes.PreValidationFailure.html b/classes/Error_Classes.PreValidationFailure.html index 163d3b5..beeb6ac 100644 --- a/classes/Error_Classes.PreValidationFailure.html +++ b/classes/Error_Classes.PreValidationFailure.html @@ -1,11 +1,11 @@ -PreValidationFailure | SuperCamo - v0.4.5

    Hierarchy

    • Error
      • PreValidationFailure

    Constructors

    constructor +PreValidationFailure | SuperCamo - v1.0.0

    Hierarchy

    • Error
      • PreValidationFailure

    Constructors

    Properties

    message: string
    name: string
    stack?: string
    prepareStackTrace?: ((err: Error, stackTraces: CallSite[]) => any)

    Optional override for formatting stack traces

    +

    Constructors

    Properties

    message: string
    name: string
    stack?: string
    prepareStackTrace?: ((err: Error, stackTraces: CallSite[]) => any)

    Optional override for formatting stack traces

    stackTraceLimit: number

    Methods

    • Create .stack property on a target object

      -

      Parameters

      • targetObject: object
      • OptionalconstructorOpt: Function

      Returns void

    +

    Parameters

    Returns void

    diff --git a/classes/Error_Classes.SaveFailure.html b/classes/Error_Classes.SaveFailure.html index 50ca1db..7931e90 100644 --- a/classes/Error_Classes.SaveFailure.html +++ b/classes/Error_Classes.SaveFailure.html @@ -1,11 +1,11 @@ -SaveFailure | SuperCamo - v0.4.5

    Hierarchy

    • Error
      • SaveFailure

    Constructors

    constructor +SaveFailure | SuperCamo - v1.0.0

    Hierarchy

    • Error
      • SaveFailure

    Constructors

    Properties

    message: string
    name: string
    stack?: string
    prepareStackTrace?: ((err: Error, stackTraces: CallSite[]) => any)

    Optional override for formatting stack traces

    +

    Constructors

    Properties

    message: string
    name: string
    stack?: string
    prepareStackTrace?: ((err: Error, stackTraces: CallSite[]) => any)

    Optional override for formatting stack traces

    stackTraceLimit: number

    Methods

    • Create .stack property on a target object

      -

      Parameters

      • targetObject: object
      • OptionalconstructorOpt: Function

      Returns void

    +

    Parameters

    Returns void

    diff --git a/classes/Error_Classes.ValidationFailure.html b/classes/Error_Classes.ValidationFailure.html index 29f33ab..153c54d 100644 --- a/classes/Error_Classes.ValidationFailure.html +++ b/classes/Error_Classes.ValidationFailure.html @@ -1,11 +1,11 @@ -ValidationFailure | SuperCamo - v0.4.5

    Hierarchy

    • Error
      • ValidationFailure

    Constructors

    constructor +ValidationFailure | SuperCamo - v1.0.0

    Hierarchy

    • Error
      • ValidationFailure

    Constructors

    Properties

    message: string
    name: string
    stack?: string
    prepareStackTrace?: ((err: Error, stackTraces: CallSite[]) => any)

    Optional override for formatting stack traces

    +

    Constructors

    Properties

    message: string
    name: string
    stack?: string
    prepareStackTrace?: ((err: Error, stackTraces: CallSite[]) => any)

    Optional override for formatting stack traces

    stackTraceLimit: number

    Methods

    • Create .stack property on a target object

      -

      Parameters

      • targetObject: object
      • OptionalconstructorOpt: Function

      Returns void

    +

    Parameters

    Returns void

    diff --git a/classes/Error_Classes.ValidationFailureMinMaxError.html b/classes/Error_Classes.ValidationFailureMinMaxError.html index 07f4402..ad5ed9c 100644 --- a/classes/Error_Classes.ValidationFailureMinMaxError.html +++ b/classes/Error_Classes.ValidationFailureMinMaxError.html @@ -1,11 +1,11 @@ -ValidationFailureMinMaxError | SuperCamo - v0.4.5

    Class ValidationFailureMinMaxError

    Hierarchy

    • Error
      • ValidationFailureMinMaxError

    Constructors

    constructor +ValidationFailureMinMaxError | SuperCamo - v1.0.0

    Class ValidationFailureMinMaxError

    Hierarchy

    • Error
      • ValidationFailureMinMaxError

    Constructors

    Properties

    message: string
    name: string
    stack?: string
    prepareStackTrace?: ((err: Error, stackTraces: CallSite[]) => any)

    Optional override for formatting stack traces

    +

    Constructors

    Properties

    message: string
    name: string
    stack?: string
    prepareStackTrace?: ((err: Error, stackTraces: CallSite[]) => any)

    Optional override for formatting stack traces

    stackTraceLimit: number

    Methods

    • Create .stack property on a target object

      -

      Parameters

      • targetObject: object
      • OptionalconstructorOpt: Function

      Returns void

    +

    Parameters

    Returns void

    diff --git a/classes/Error_Classes.ValidationFailureMissingValueForProperty.html b/classes/Error_Classes.ValidationFailureMissingValueForProperty.html index 4aff186..42d32b2 100644 --- a/classes/Error_Classes.ValidationFailureMissingValueForProperty.html +++ b/classes/Error_Classes.ValidationFailureMissingValueForProperty.html @@ -1,11 +1,11 @@ -ValidationFailureMissingValueForProperty | SuperCamo - v0.4.5

    Class ValidationFailureMissingValueForProperty

    Hierarchy

    • Error
      • ValidationFailureMissingValueForProperty

    Constructors

    constructor +ValidationFailureMissingValueForProperty | SuperCamo - v1.0.0

    Class ValidationFailureMissingValueForProperty

    Hierarchy

    • Error
      • ValidationFailureMissingValueForProperty

    Constructors

    Properties

    message: string
    name: string
    stack?: string
    prepareStackTrace?: ((err: Error, stackTraces: CallSite[]) => any)

    Optional override for formatting stack traces

    +

    Constructors

    Properties

    message: string
    name: string
    stack?: string
    prepareStackTrace?: ((err: Error, stackTraces: CallSite[]) => any)

    Optional override for formatting stack traces

    stackTraceLimit: number

    Methods

    • Create .stack property on a target object

      -

      Parameters

      • targetObject: object
      • OptionalconstructorOpt: Function

      Returns void

    +

    Parameters

    Returns void

    diff --git a/classes/Error_Classes.ValidationFailureMissingValueForReferencedDoc.html b/classes/Error_Classes.ValidationFailureMissingValueForReferencedDoc.html index a6906b5..c305947 100644 --- a/classes/Error_Classes.ValidationFailureMissingValueForReferencedDoc.html +++ b/classes/Error_Classes.ValidationFailureMissingValueForReferencedDoc.html @@ -1,11 +1,11 @@ -ValidationFailureMissingValueForReferencedDoc | SuperCamo - v0.4.5

    Class ValidationFailureMissingValueForReferencedDoc

    Hierarchy

    • Error
      • ValidationFailureMissingValueForReferencedDoc

    Constructors

    constructor +ValidationFailureMissingValueForReferencedDoc | SuperCamo - v1.0.0

    Class ValidationFailureMissingValueForReferencedDoc

    Hierarchy

    • Error
      • ValidationFailureMissingValueForReferencedDoc

    Constructors

    Properties

    message: string
    name: string
    stack?: string
    prepareStackTrace?: ((err: Error, stackTraces: CallSite[]) => any)

    Optional override for formatting stack traces

    +

    Constructors

    Properties

    message: string
    name: string
    stack?: string
    prepareStackTrace?: ((err: Error, stackTraces: CallSite[]) => any)

    Optional override for formatting stack traces

    stackTraceLimit: number

    Methods

    • Create .stack property on a target object

      -

      Parameters

      • targetObject: object
      • OptionalconstructorOpt: Function

      Returns void

    +

    Parameters

    Returns void

    diff --git a/classes/Error_Classes.ValidationFailureReferenceWithoutDatabase.html b/classes/Error_Classes.ValidationFailureReferenceWithoutDatabase.html index 52c2828..8869e64 100644 --- a/classes/Error_Classes.ValidationFailureReferenceWithoutDatabase.html +++ b/classes/Error_Classes.ValidationFailureReferenceWithoutDatabase.html @@ -1,11 +1,11 @@ -ValidationFailureReferenceWithoutDatabase | SuperCamo - v0.4.5

    Class ValidationFailureReferenceWithoutDatabase

    Hierarchy

    • Error
      • ValidationFailureReferenceWithoutDatabase

    Constructors

    constructor +ValidationFailureReferenceWithoutDatabase | SuperCamo - v1.0.0

    Class ValidationFailureReferenceWithoutDatabase

    Hierarchy

    • Error
      • ValidationFailureReferenceWithoutDatabase

    Constructors

    Properties

    message: string
    name: string
    stack?: string
    prepareStackTrace?: ((err: Error, stackTraces: CallSite[]) => any)

    Optional override for formatting stack traces

    +

    Constructors

    Properties

    message: string
    name: string
    stack?: string
    prepareStackTrace?: ((err: Error, stackTraces: CallSite[]) => any)

    Optional override for formatting stack traces

    stackTraceLimit: number

    Methods

    • Create .stack property on a target object

      -

      Parameters

      • targetObject: object
      • OptionalconstructorOpt: Function

      Returns void

    +

    Parameters

    Returns void

    diff --git a/classes/Error_Classes.ValidationFailureUnexpectedProperty.html b/classes/Error_Classes.ValidationFailureUnexpectedProperty.html index 2acb770..275ffd3 100644 --- a/classes/Error_Classes.ValidationFailureUnexpectedProperty.html +++ b/classes/Error_Classes.ValidationFailureUnexpectedProperty.html @@ -1,11 +1,11 @@ -ValidationFailureUnexpectedProperty | SuperCamo - v0.4.5

    Class ValidationFailureUnexpectedProperty

    Hierarchy

    • Error
      • ValidationFailureUnexpectedProperty

    Constructors

    constructor +ValidationFailureUnexpectedProperty | SuperCamo - v1.0.0

    Class ValidationFailureUnexpectedProperty

    Hierarchy

    • Error
      • ValidationFailureUnexpectedProperty

    Constructors

    Properties

    message: string
    name: string
    stack?: string
    prepareStackTrace?: ((err: Error, stackTraces: CallSite[]) => any)

    Optional override for formatting stack traces

    +

    Constructors

    Properties

    message: string
    name: string
    stack?: string
    prepareStackTrace?: ((err: Error, stackTraces: CallSite[]) => any)

    Optional override for formatting stack traces

    stackTraceLimit: number

    Methods

    • Create .stack property on a target object

      -

      Parameters

      • targetObject: object
      • OptionalconstructorOpt: Function

      Returns void

    +

    Parameters

    Returns void

    diff --git a/classes/Error_Classes.ValidationFailureValueNotInChoices.html b/classes/Error_Classes.ValidationFailureValueNotInChoices.html index 1a66241..d243fdd 100644 --- a/classes/Error_Classes.ValidationFailureValueNotInChoices.html +++ b/classes/Error_Classes.ValidationFailureValueNotInChoices.html @@ -1,11 +1,11 @@ -ValidationFailureValueNotInChoices | SuperCamo - v0.4.5

    Class ValidationFailureValueNotInChoices

    Hierarchy

    • Error
      • ValidationFailureValueNotInChoices

    Constructors

    constructor +ValidationFailureValueNotInChoices | SuperCamo - v1.0.0

    Class ValidationFailureValueNotInChoices

    Hierarchy

    • Error
      • ValidationFailureValueNotInChoices

    Constructors

    Properties

    message: string
    name: string
    stack?: string
    prepareStackTrace?: ((err: Error, stackTraces: CallSite[]) => any)

    Optional override for formatting stack traces

    +

    Constructors

    Properties

    message: string
    name: string
    stack?: string
    prepareStackTrace?: ((err: Error, stackTraces: CallSite[]) => any)

    Optional override for formatting stack traces

    stackTraceLimit: number

    Methods

    • Create .stack property on a target object

      -

      Parameters

      • targetObject: object
      • OptionalconstructorOpt: Function

      Returns void

    +

    Parameters

    Returns void

    diff --git a/documents/Quick_Start.html b/documents/Quick_Start.html index 0ace434..13bb9c9 100644 --- a/documents/Quick_Start.html +++ b/documents/Quick_Start.html @@ -1,4 +1,4 @@ -Quick Start | SuperCamo - v0.4.5

    This is a NoSQL "ODM" built for usage with NeDB. You can define schemas for the data that you want to store in a NeDB database, and the objects that get used within NeDB will obey the rules and functionalities defined by your schemas.

    +Quick Start | SuperCamo - v1.0.0

    This is a NoSQL "ODM" built for usage with NeDB. You can define schemas for the data that you want to store in a NeDB database, and the objects that get used within NeDB will obey the rules and functionalities defined by your schemas.

    It's like how MongooseJS is for MongoDB - SuperCamo is for NeDB.

    Install this package as a production dependency using this command:

    npm install @bigfootds/supercamo
    @@ -42,4 +42,4 @@
     
    const { 
    // Used for document definitions
    NedbEmbeddedDocument,
    // Used for document definitions
    NedbDocument,
    // Used for most package functionality, especially database interactions
    SuperCamo,
    // Used for database client initial connections
    CollectionListEntry,
    // Handy for JSDoc typing or other intellisense, in this code example
    NedbClient
    } = require("@bigfootds/supercamo");

    // Realistically, you'll wanna use `path` to figure out a good, relative, cross-platform path for your database storage.
    const path = require("node:path");


    class Bio extends NedbEmbeddedDocument {
    constructor(newData, newParentDatabaseName, newCollectionName){
    super(newData, newParentDatabaseName, newCollectionName);

    this.rules = {
    tagline: {
    type: String,
    required: true,
    unique: false
    },
    blurb: {
    type: String,
    required: true,
    unique: false
    }
    }
    }
    }

    class User extends NedbDocument {
    constructor(newData, newParentDatabaseName, newCollectionName){
    super(newData, newParentDatabaseName, newCollectionName);

    this.rules = {
    email: {
    type: String,
    required: true,
    unique: true
    },
    bio: {
    type: Bio,
    required: false
    }
    }
    }
    }


    async function databaselessExample(){
    let newUserInstance = new User({
    email: "contact@bigfootds.com",
    bio: {
    blurb: "Some cool blurb goes here.",
    tagline: "Some cool tagline goes here."
    }
    });

    await newUserInstance.validate().catch(error => {
    console.log("Validation failed.");
    throw error;
    });

    console.log("Validation passed!");
    console.log(newUserInstance.data);
    }

    async function databaseConnectedExample(){

    /**
    * @type {NedbClient}
    */
    let newClient = SuperCamo.clientConnect(
    "QuickstartDatabase",
    path.join(process.cwd(), "databases", "QuickStartDatabase"),
    [
    new CollectionListEntry("Users", User),
    ]
    );

    let newUser = await newClient.createOne("Users", {
    email: "contact@bigfootds.com",
    bio: {
    blurb: "Some cool blurb goes here.",
    tagline: "Some cool tagline goes here."
    }
    });

    console.log(newUser.data);

    // In other files, you can retrieve that connected database client through SuperCamo too.
    // So you wanna connect to a specific database once, and retrieve that connection throughout your project.
    let quickstartDbRetrieved = SuperCamo.clientGet("QuickstartDatabase");
    let foundUser = await quickstartDbRetrieved.findOneDocument("Users", {email: "contact@bigfootds.com"});

    console.log(foundUser.data);

    }

    // Use one or the other to see the code in action.
    // databaselessExample();
    // databaseConnectedExample();
    -
    +
    diff --git a/documents/The_Basics.00___Understanding_This_Package.html b/documents/The_Basics.00___Understanding_This_Package.html index a99fd7f..308b068 100644 --- a/documents/The_Basics.00___Understanding_This_Package.html +++ b/documents/The_Basics.00___Understanding_This_Package.html @@ -1,4 +1,4 @@ -00 - Understanding This Package | SuperCamo - v0.4.5

    SuperCamo is a package built as a wrapper around NeDB. It contains several key parts that you need to understand to really make good use of this package, and you would benefit from also digging around in NeDB package documentation - but we'll point that out when it's necessary in the other documentation pages.

    +00 - Understanding This Package | SuperCamo - v1.0.0

    SuperCamo is a package built as a wrapper around NeDB. It contains several key parts that you need to understand to really make good use of this package, and you would benefit from also digging around in NeDB package documentation - but we'll point that out when it's necessary in the other documentation pages.

    This page will walk you through the key components of this package and briefly explain what they are, as well as when you need to use them.

    There are a lot of moving pieces in this system. In a nutshell:

    This package is all about making it easier to manage multiple NeDB database connections within a single app's lifetime. The SuperCamo singleton is how that happens.

    @@ -39,4 +39,4 @@

    Read more about the SuperCamo database client on its tutorial page.

    So, those are the four main components to SuperCamo. If that sounds interesting to you, keep digging into this documentation and start coding!

    Go and get started!

    -
    +
    diff --git a/documents/The_Basics.01___The_SuperCamo_Singleton.html b/documents/The_Basics.01___The_SuperCamo_Singleton.html index 6f820c9..493b7b5 100644 --- a/documents/The_Basics.01___The_SuperCamo_Singleton.html +++ b/documents/The_Basics.01___The_SuperCamo_Singleton.html @@ -1,4 +1,4 @@ -01 - The SuperCamo Singleton | SuperCamo - v0.4.5

    This package is all about making it easier to manage multiple NeDB database connections within a single app's lifetime. The SuperCamo singleton is how that happens.

    +01 - The SuperCamo Singleton | SuperCamo - v1.0.0

    This package is all about making it easier to manage multiple NeDB database connections within a single app's lifetime. The SuperCamo singleton is how that happens.

    Essentially, you should connect to a database via the SuperCamo singleton. The SuperCamo.clientConnect() function returns a reference to the database client instance, and that same instance can be retrieved again in any file that uses the SuperCamo singleton too.

    This means that when your app runs, you should follow this process:

      @@ -20,4 +20,4 @@
      const SuperCamo = require("@bigfootds/supercamo");
      const databaseInstance = SuperCamo.clientGet("BasicExampleDatabase");

      router.get("/all", async (request, response) => {
      let availableArticles = await databaseInstance.findManyObjects("Articles", {});

      response.json(availableArticles);
      });
      -
    +
    diff --git a/documents/The_Basics.02___Document_Basics.html b/documents/The_Basics.02___Document_Basics.html index d8d6643..17135f3 100644 --- a/documents/The_Basics.02___Document_Basics.html +++ b/documents/The_Basics.02___Document_Basics.html @@ -1,4 +1,4 @@ -02 - Document Basics | SuperCamo - v0.4.5

    NeDB is a NoSQL database. That means that instead of tables and rows to represent entities of data, we use collections of documents.

    +02 - Document Basics | SuperCamo - v1.0.0

    NeDB is a NoSQL database. That means that instead of tables and rows to represent entities of data, we use collections of documents.

    Traditionally, one NeDB datastore is one collection. SuperCamo manages that for you, so you just have to assign a document and a collection name to a database client to make that work the same way you'd expect from popular NoSQL systems like MongoDB and MongooseJS.

    Declaring a document is how you can define a schema or structure for your data.

    Like so:

    @@ -28,4 +28,4 @@

    The above example queries for a user with a username that exactly matches "Bigfoot", and returns an instance of the User document with the data of that matching user.

    Documents can refer to other documents, specify minimum and maximum values of properties, restrict property values to a set of choices, and more. You can read more about Document usage and functionalities in other pages - this is just a brief intro for now! 😉

    -
    +
    diff --git a/documents/The_Basics.03___Embedded_Document_Basics.html b/documents/The_Basics.03___Embedded_Document_Basics.html index 6044800..d4353f3 100644 --- a/documents/The_Basics.03___Embedded_Document_Basics.html +++ b/documents/The_Basics.03___Embedded_Document_Basics.html @@ -1,4 +1,4 @@ -03 - Embedded Document Basics | SuperCamo - v0.4.5

    Subdocuments or embedded documents are a way of structuring complex data nested within documents. While a document can have objects as its properties/fields, it's typically more straightforward to create embedded documents to represent objects instead.

    +03 - Embedded Document Basics | SuperCamo - v1.0.0

    Subdocuments or embedded documents are a way of structuring complex data nested within documents. While a document can have objects as its properties/fields, it's typically more straightforward to create embedded documents to represent objects instead.

    Embedded documents have their own validation step, so you can configure validation rules in a declared embedded document and they will run when the document that contains the embedded document runs. Might sound hard to keep track of, but basically: embedded documents are identical to regular documents, except you cannot use embedded documents as standalone documents. They can only exist as properties within documents.

    For example:

    const {NedbEmbeddedDocument} = require('@bigfootds/supercamo');
    const ISO6391 = require('iso-639-1');
    let allowedLanguageCodes = ISO6391.getAllCodes();

    class LocalizedContent extends NedbEmbeddedDocument {
    constructor(data, databaseName, collectionName){
    super(data, databaseName, collectionName);

    /**
    * A two-letter language code that matches the language of this subdocument's name and content.
    * Examples: "EN", "FR", "DE"
    * Refer to the ISO-639-1 standard online for the full list of usable codes.
    */
    this.language = {
    type: String,
    choices: allowedLanguageCodes,
    unique: false,
    required: true
    }

    /**
    * Content written in the language assigned to this.language.
    */
    this.content = {
    type: String,
    required: true,
    unique: false
    }
    }

    }


    module.exports = { LocalizedContent }; @@ -14,4 +14,4 @@

    Embedded documents are not impacted by any document population settings - a query to a document will return all of its embedded document data.

    This is because embedded documents are stored as objects within the containing document, and only convert back into Embedded Document instances during validation steps.

    -
    +
    diff --git a/documents/The_Basics.04___DB_Client_Basics.html b/documents/The_Basics.04___DB_Client_Basics.html index 9a3062d..5f3502e 100644 --- a/documents/The_Basics.04___DB_Client_Basics.html +++ b/documents/The_Basics.04___DB_Client_Basics.html @@ -1,4 +1,4 @@ -04 - DB Client Basics | SuperCamo - v0.4.5

    The database client is the main way that you should be interacting with the database in this package.

    +04 - DB Client Basics | SuperCamo - v1.0.0

    The database client is the main way that you should be interacting with the database in this package.

    To work with data based on the documents that you've defined, you must create an instance of a database client.

    Essentially, we must tell each database client instance which documents (a.k.a models) they're allowed to use. We do this by specifying a key-value pair list of collections and their models.

    const SuperCamo = require("@bigfootds/supercamo");

    let exampleDb = await SuperCamo.connect(
    "SomeDatabaseName",
    path.join(process.cwd(), "databases", "SomeDatabaseName"),
    [
    {name: "Users", model: User},
    {name: "Admins", model: User},
    {name: "Profiles", model: Profile},
    {name: "Config", model: Settings}
    ]
    ); @@ -13,4 +13,4 @@
    let newUser = await exampleDb.insertOne("Users", {name:"Alex", email:"test@email.com"})
    console.log(newUser.toString());

    let newUsers = await anotherDb.insertMany("Users", [
    {name:"Not Alex", email:"test@email.com"},
    {name:"Definitely Not Alex", email:"test2@email.com"},
    {name:"Could be Alex, but probably not", email:"test3@email.com"},
    ]);
    console.log(newUsers.toString());
    -
    +
    diff --git a/documents/The_Basics.html b/documents/The_Basics.html index 48ee18d..115ef60 100644 --- a/documents/The_Basics.html +++ b/documents/The_Basics.html @@ -1,7 +1,7 @@ -The Basics | SuperCamo - v0.4.5

    This section introduces the fundamental concepts that this package relies on. There are only a few main components. In general, when using this package, you will want to:

    +The Basics | SuperCamo - v1.0.0

    This section introduces the fundamental concepts that this package relies on. There are only a few main components. In general, when using this package, you will want to:

    1. Define your documents and subdocuments.
    2. Create database client instances that use your defined documents and their subdocuments.
    3. Use database client instances to interact with a database and its data.
    -
    +
    diff --git a/documents/Tips___Tricks.html b/documents/Tips___Tricks.html index d0d9d24..e45c38d 100644 --- a/documents/Tips___Tricks.html +++ b/documents/Tips___Tricks.html @@ -1,4 +1,4 @@ -Tips & Tricks | SuperCamo - v0.4.5

    There are some cool things that you can do with this package!

    +Tips & Tricks | SuperCamo - v1.0.0

    There are some cool things that you can do with this package!

    TypeScript can pick up more information from this package than regular JavaScript can. This isn't a huge deal, but it does help in some situations, such as when you're declaring the rules within a document.

    When your cursor is within a rule object, you can enter a keyboard shortcut to show all compatible values based on your cursor's position. In TypeScript, this will show all possible constraints that you can define in a document's rule. Like so:

    A screenshot of Visual Studio Code, showing an intellisense menu pop-up.

    @@ -17,4 +17,4 @@
    class CustomClient extends NedbClient {
    constructor(dbName, dbDirectoryPath, collectionsList, coolFactor){
    super(dbName, dbDirectoryPath, collectionsList);

    this.coolFactor = coolFactor || 10;
    }
    }
    -
    +
    diff --git a/functions/Logging.SuperCamoLogger.html b/functions/Logging.SuperCamoLogger.html index f8235c0..fb0fe1c 100644 --- a/functions/Logging.SuperCamoLogger.html +++ b/functions/Logging.SuperCamoLogger.html @@ -1,4 +1,4 @@ -SuperCamoLogger | SuperCamo - v0.4.5

    Function SuperCamoLogger

    • Pass a string to this, and it'll automatically figure out which NodeJS util.DebugLogger to use.

      +SuperCamoLogger | SuperCamo - v1.0.0

      Function SuperCamoLogger

      • Pass a string to this, and it'll automatically figure out which NodeJS util.DebugLogger to use.

        This is not a function that you should be using within your own project's code, but this is more for anyone who is contributing to SuperCamo development to use.

        If you're not a contributor, you may just wanna stick to the parent "Logging" page so you can see the NODE_DEBUG values that you can use to see this package's logger output instead.

        You would use this within the SuperCamo package's code in place of console.log statements. Refer to the example section below.

        @@ -8,4 +8,4 @@

        BigfootDS

        -
      +
    diff --git a/hierarchy.html b/hierarchy.html index 2ef72f0..d45594f 100644 --- a/hierarchy.html +++ b/hierarchy.html @@ -1 +1 @@ -SuperCamo - v0.4.5
    +SuperCamo - v1.0.0
    diff --git a/index.html b/index.html index d85c571..dd3a005 100644 --- a/index.html +++ b/index.html @@ -1,4 +1,4 @@ -SuperCamo - v0.4.5

    SuperCamo - v0.4.5

    SuperCamo

    SuperCamo is a Camo-inspired object data modeller (ODM) for NeDB, built specifically for BigfootDS' needs.

    +SuperCamo - v1.0.0

    SuperCamo - v1.0.0

    SuperCamo

    SuperCamo is a Camo-inspired object data modeller (ODM) for NeDB, built specifically for BigfootDS' needs.

    This package was inspired by Scott Robinson's Camo ODM - but BigfootDS had some specific needs and an urge to try out TypeScript. We greatly appreciate what Camo is and does!

    • NPM package
    • @@ -28,4 +28,4 @@
    • ElectronJS app - NOT YET IMPLEMENTED

    Those repositories are also used to dogfood this library - features needed for those projects will be prioritised. Check their readme files to see what is mapped out on each repository.

    -
    +
    diff --git a/interfaces/Interfaces.BaseDocument.html b/interfaces/Interfaces.BaseDocument.html index 8f2e7de..2569508 100644 --- a/interfaces/Interfaces.BaseDocument.html +++ b/interfaces/Interfaces.BaseDocument.html @@ -1,4 +1,4 @@ -BaseDocument | SuperCamo - v0.4.5

    Interface BaseDocument

    interface BaseDocument {
        collectionName: null | string;
        data: DocumentConstructorData;
        parentDatabaseName: null | string;
    }

    Implemented by

    Properties

    collectionName +BaseDocument | SuperCamo - v1.0.0

    Interface BaseDocument

    interface BaseDocument {
        collectionName: null | string;
        data: DocumentConstructorData;
        parentDatabaseName: null | string;
    }

    Implemented by

    Properties

    collectionName: null | string

    The name of the collection that the data for this document instance has come from. Useful for checking if a database already has this document when a database client is using the same model in multiple collections, from the document or generic functions.

    @@ -12,10 +12,10 @@

    BigfootDS

    -

    Storage of the document data, used when making instances of document-based classes to create documents.

    +

    Storage of the document data, used when making instances of document-based classes to create documents.

    eg. this.username would define the rules that the data must obey for the username property of a document, while the actual data for username should live in this.data.username.

    BigfootDS

    -
    parentDatabaseName: null | string

    The name of the database that the data for this document instance has come from. Useful for checking if a database already has this document, from the document or generic functions.

    +
    parentDatabaseName: null | string

    The name of the database that the data for this document instance has come from. Useful for checking if a database already has this document, from the document or generic functions.

    However, this will be null if the document instance was created without the involvement of a database query.

    No value:

    let newUser = await User.create({username:"alex"});
    console.log(newUser.parentDatabaseName); // null/undefined expected @@ -26,4 +26,4 @@

    BigfootDS

    -
    +
    diff --git a/interfaces/Interfaces.CollectionAccessor.html b/interfaces/Interfaces.CollectionAccessor.html index e128b00..6ecd056 100644 --- a/interfaces/Interfaces.CollectionAccessor.html +++ b/interfaces/Interfaces.CollectionAccessor.html @@ -1,13 +1,13 @@ -CollectionAccessor | SuperCamo - v0.4.5

    Interface CollectionAccessor

    interface CollectionAccessor {
        datastore: Nedb<Record<string, any>>;
        model: typeof NedbDocument;
        name: string;
        path: string;
    }

    Implemented by

    Properties

    datastore +CollectionAccessor | SuperCamo - v1.0.0

    Interface CollectionAccessor

    interface CollectionAccessor {
        datastore: Nedb<Record<string, any>>;
        model: typeof NedbDocument;
        name: string;
        path: string;
    }

    Implemented by

    Properties

    datastore: Nedb<Record<string, any>>

    Reference to the NeDB Datastore object for this collection.

    BigfootDS

    -
    model: typeof NedbDocument

    Reference to the NedbDocument-inheriting class used to define the collection's data structure.

    +
    model: typeof NedbDocument

    Reference to the NedbDocument-inheriting class used to define the collection's data structure.

    BigfootDS

    -
    name: string

    Name of the collection.

    +
    name: string

    Name of the collection.

    BigfootDS

    -
    path: string

    Path to its ".db" NeDB file.

    +
    path: string

    Path to its ".db" NeDB file.

    BigfootDS

    -
    +
    diff --git a/interfaces/Interfaces.CollectionsListEntry.html b/interfaces/Interfaces.CollectionsListEntry.html index b63ed37..8f14d0f 100644 --- a/interfaces/Interfaces.CollectionsListEntry.html +++ b/interfaces/Interfaces.CollectionsListEntry.html @@ -1,7 +1,7 @@ -CollectionsListEntry | SuperCamo - v0.4.5

    Interface CollectionsListEntry

    interface CollectionsListEntry {
        model: typeof NedbDocument;
        name: string;
    }

    Implemented by

    Properties

    model +CollectionsListEntry | SuperCamo - v1.0.0

    Interface CollectionsListEntry

    interface CollectionsListEntry {
        model: typeof NedbDocument;
        name: string;
    }

    Implemented by

    Properties

    Properties

    model: typeof NedbDocument

    Reference to the NedbDocument-inheriting class used to define the collection's data structure.

    BigfootDS

    -
    name: string

    Name of the collection.

    +
    name: string

    Name of the collection.

    BigfootDS

    -
    +
    diff --git a/interfaces/Interfaces.DocumentBaseData.html b/interfaces/Interfaces.DocumentBaseData.html index 9a6ca24..5afc4b9 100644 --- a/interfaces/Interfaces.DocumentBaseData.html +++ b/interfaces/Interfaces.DocumentBaseData.html @@ -1 +1 @@ -DocumentBaseData | SuperCamo - v0.4.5
    +DocumentBaseData | SuperCamo - v1.0.0
    diff --git a/interfaces/Interfaces.DocumentConstructorData.html b/interfaces/Interfaces.DocumentConstructorData.html index 9439f6f..55883fa 100644 --- a/interfaces/Interfaces.DocumentConstructorData.html +++ b/interfaces/Interfaces.DocumentConstructorData.html @@ -1,2 +1,2 @@ -DocumentConstructorData | SuperCamo - v0.4.5

    Interface DocumentConstructorData

    interface DocumentConstructorData {
        _id?: string;
    }

    Hierarchy (view full)

    Properties

    Properties

    _id?: string
    +DocumentConstructorData | SuperCamo - v1.0.0

    Interface DocumentConstructorData

    interface DocumentConstructorData {
        _id?: string;
    }

    Hierarchy (view full)

    Properties

    Properties

    _id?: string
    diff --git a/interfaces/Interfaces.DocumentKeyRule.html b/interfaces/Interfaces.DocumentKeyRule.html index abbd5c8..bd7fa79 100644 --- a/interfaces/Interfaces.DocumentKeyRule.html +++ b/interfaces/Interfaces.DocumentKeyRule.html @@ -1,4 +1,4 @@ -DocumentKeyRule | SuperCamo - v0.4.5

    Interface DocumentKeyRule

    interface DocumentKeyRule {
        choices?: any[];
        collection?: string;
        default?: any;
        invalidateOnMinMaxError?: boolean;
        match?: string | RegExp;
        max?: number;
        maxLength?: number;
        min?: number;
        minLength?: number;
        padArrayValue?: any;
        padStringValue?: string;
        required?: boolean;
        type: any;
        unique?: boolean;
        validate?: Function;
    }

    Properties

    choices? +DocumentKeyRule | SuperCamo - v1.0.0

    Interface DocumentKeyRule

    interface DocumentKeyRule {
        choices?: any[];
        collection?: string;
        default?: any;
        invalidateOnMinMaxError?: boolean;
        match?: string | RegExp;
        max?: number;
        maxLength?: number;
        min?: number;
        minLength?: number;
        padArrayValue?: any;
        padStringValue?: string;
        required?: boolean;
        type: any;
        unique?: boolean;
        validate?: Function;
    }

    Properties

    choices?: any[]

    An array of data that should match the specified type, to restrict the possible values of this property.

    BigfootDS

    -
    collection?: string

    Used for properties that are references to other documents. The value of this should be the name of the collection that the referenced document lives in. +

    collection?: string

    Used for properties that are references to other documents. The value of this should be the name of the collection that the referenced document lives in. eg. collection: "Users", would be useful for refering to documents that live in a "Users" collection of a database. No, you cannot refer to collections that exist in separate database clients.

    BigfootDS

    -
    default?: any

    The default data of this property, to be used if no data is provided or if a soft-invalidation occurs.

    +
    default?: any

    The default data of this property, to be used if no data is provided or if a soft-invalidation occurs.

    BigfootDS

    -
    invalidateOnMinMaxError?: boolean

    Determines whether not an invalid value for min, max, minLength, and maxLength properties will throw an error or just roll-over and allow the value to exist. +

    invalidateOnMinMaxError?: boolean

    Determines whether not an invalid value for min, max, minLength, and maxLength properties will throw an error or just roll-over and allow the value to exist. Depending on the property, it may get replaced with a default or min or max value if this is set to false.

    BigfootDS

    -
    match?: string | RegExp

    The regex expression that will be run against this property's data value. If the regex doesn't match, validation fails.

    +
    match?: string | RegExp

    The regex expression that will be run against this property's data value. If the regex doesn't match, validation fails.

    BigfootDS

    -
    max?: number

    The highest value that this property can have for its data value. +

    max?: number

    The highest value that this property can have for its data value. For properties that are numbers.

    BigfootDS

    -
    maxLength?: number

    The highest length that this property can have for its data value. +

    maxLength?: number

    The highest length that this property can have for its data value. For properties that are strings or arrays.

    BigfootDS

    -
    min?: number

    The lowest value that this property can have for its data value. +

    min?: number

    The lowest value that this property can have for its data value. For properties that are numbers.

    BigfootDS

    -
    minLength?: number

    The shortest length that this property can have for its data value. +

    minLength?: number

    The shortest length that this property can have for its data value. For properties that are strings or arrays.

    BigfootDS

    -
    padArrayValue?: any

    If an array data value's length is too short, this is the value that will be used to pad the array until it meets the minLength property.

    +
    padArrayValue?: any

    If an array data value's length is too short, this is the value that will be used to pad the array until it meets the minLength property.

    BigfootDS

    -
    padStringValue?: string

    If a string data value is too short, this is the value that will be used to pad the data until it meets the minLength property.

    +
    padStringValue?: string

    If a string data value is too short, this is the value that will be used to pad the data until it meets the minLength property.

    BigfootDS

    -
    required?: boolean

    Whether or not a property defined in the document's rules object must have a value in its data.

    +
    required?: boolean

    Whether or not a property defined in the document's rules object must have a value in its data.

    BigfootDS

    -
    type: any

    A JavaScript class or type. +

    type: any

    A JavaScript class or type. This should be on every document key rule object, it is required. Various other constraints depend on the type!

    BigfootDS

    -
    unique?: boolean

    Whether or not the data value for this property should be unique within the database. This sets up a NeDB index, so it's not immediately checked at a SuperCamo level - but NeDB immediately enforces it.

    +
    unique?: boolean

    Whether or not the data value for this property should be unique within the database. This sets up a NeDB index, so it's not immediately checked at a SuperCamo level - but NeDB immediately enforces it.

    BigfootDS

    -
    validate?: Function

    A custom validate function that runs alongside any other constraints. The function must receive one parameter, which the document will pass in automatically - the parameter is the document's data for this property.

    +
    validate?: Function

    A custom validate function that runs alongside any other constraints. The function must receive one parameter, which the document will pass in automatically - the parameter is the document's data for this property.

    BigfootDS

    -
    +
    diff --git a/interfaces/Interfaces.DocumentObjectData.html b/interfaces/Interfaces.DocumentObjectData.html index e06eed3..a45fe46 100644 --- a/interfaces/Interfaces.DocumentObjectData.html +++ b/interfaces/Interfaces.DocumentObjectData.html @@ -1,2 +1,2 @@ -DocumentObjectData | SuperCamo - v0.4.5

    Interface DocumentObjectData

    interface DocumentObjectData {
        _id: string;
    }

    Hierarchy (view full)

    Properties

    _id -

    Properties

    _id: string
    +DocumentObjectData | SuperCamo - v1.0.0

    Interface DocumentObjectData

    interface DocumentObjectData {
        _id: string;
    }

    Hierarchy (view full)

    Properties

    _id +

    Properties

    _id: string
    diff --git a/interfaces/Interfaces.NedbClientEntry.html b/interfaces/Interfaces.NedbClientEntry.html index f0b7c76..98b44dd 100644 --- a/interfaces/Interfaces.NedbClientEntry.html +++ b/interfaces/Interfaces.NedbClientEntry.html @@ -1,16 +1,16 @@ -NedbClientEntry | SuperCamo - v0.4.5

    Interface NedbClientEntry

    interface NedbClientEntry {
        collections: CollectionAccessor[];
        documents: typeof NedbDocument[];
        embeddedDocuments: typeof NedbEmbeddedDocument[];
        name: string;
        path: string;
    }

    Implemented by

    Properties

    collections +NedbClientEntry | SuperCamo - v1.0.0

    Interface NedbClientEntry

    interface NedbClientEntry {
        collections: CollectionAccessor[];
        documents: typeof NedbDocument[];
        embeddedDocuments: typeof NedbEmbeddedDocument[];
        name: string;
        path: string;
    }

    Implemented by

    Properties

    collections: CollectionAccessor[]

    Array of collections used by this NeDB client. This is essentially where you track what models and collections are used in this particular database.

    BigfootDS

    -
    documents: typeof NedbDocument[]

    Array of documents used by the collections within this NeDB client. This should be a smaller array than the collections, since multiple collections could be using the same document.

    +
    documents: typeof NedbDocument[]

    Array of documents used by the collections within this NeDB client. This should be a smaller array than the collections, since multiple collections could be using the same document.

    BigfootDS

    -
    embeddedDocuments: typeof NedbEmbeddedDocument[]

    Array of subdocuments or embedded documents used by the documents within the collections of this NeDB client.

    +
    embeddedDocuments: typeof NedbEmbeddedDocument[]

    Array of subdocuments or embedded documents used by the documents within the collections of this NeDB client.

    BigfootDS

    -
    name: string

    Human-friendly name to identify the database when an app using SuperCamo is using multiple NeDB database connections simultaneously.

    +
    name: string

    Human-friendly name to identify the database when an app using SuperCamo is using multiple NeDB database connections simultaneously.

    BigfootDS

    -
    path: string

    The absolute file path to the folder that represents this NeDB client. Its collections are individual NeDB datastore files contained within this folder.

    +
    path: string

    The absolute file path to the folder that represents this NeDB client. Its collections are individual NeDB datastore files contained within this folder.

    BigfootDS

    -
    +
    diff --git a/interfaces/Interfaces.findManyDocumentsOptions.html b/interfaces/Interfaces.findManyDocumentsOptions.html index 0d19a32..40de094 100644 --- a/interfaces/Interfaces.findManyDocumentsOptions.html +++ b/interfaces/Interfaces.findManyDocumentsOptions.html @@ -1,6 +1,6 @@ -findManyDocumentsOptions | SuperCamo - v0.4.5

    Interface findManyDocumentsOptions

    Configuration object for methods that find many documents at once.

    +findManyDocumentsOptions | SuperCamo - v1.0.0

    Interface findManyDocumentsOptions

    Configuration object for methods that find many documents at once.

    BigfootDS

    -
    interface findManyDocumentsOptions {
        limit: number;
    }

    Properties

    interface findManyDocumentsOptions {
        limit: number;
    }

    Properties

    Properties

    limit: number

    A number to limit how many documents should be returned during a findMany operation.

    BigfootDS

    -
    +
    diff --git a/interfaces/Interfaces.findManyObjectsOptions.html b/interfaces/Interfaces.findManyObjectsOptions.html index 3d2d14d..b92a9ac 100644 --- a/interfaces/Interfaces.findManyObjectsOptions.html +++ b/interfaces/Interfaces.findManyObjectsOptions.html @@ -1,10 +1,10 @@ -findManyObjectsOptions | SuperCamo - v0.4.5

    Interface findManyObjectsOptions

    Configuration object for methods that find many documents as objects at once.

    +findManyObjectsOptions | SuperCamo - v1.0.0

    Interface findManyObjectsOptions

    Configuration object for methods that find many documents as objects at once.

    BigfootDS

    -
    interface findManyObjectsOptions {
        limit: number;
        projection: object;
    }

    Properties

    interface findManyObjectsOptions {
        limit: number;
        projection: object;
    }

    Properties

    Properties

    limit: number

    A number to limit how many documents should be returned during a findMany operation.

    BigfootDS

    -
    projection: object

    A NeDB projection object. This is passed along as-is to NeDB, so please refer to their documentation about projections.

    +
    projection: object

    A NeDB projection object. This is passed along as-is to NeDB, so please refer to their documentation about projections.

    https://github.com/louischatriot/nedb?tab=readme-ov-file#projections

    BigfootDS

    -
    +
    diff --git a/interfaces/Interfaces.findOneObjectOptions.html b/interfaces/Interfaces.findOneObjectOptions.html index eecdac3..e011bae 100644 --- a/interfaces/Interfaces.findOneObjectOptions.html +++ b/interfaces/Interfaces.findOneObjectOptions.html @@ -1,5 +1,5 @@ -findOneObjectOptions | SuperCamo - v0.4.5

    Interface findOneObjectOptions

    interface findOneObjectOptions {
        projection: object;
    }

    Properties

    projection +findOneObjectOptions | SuperCamo - v1.0.0

    Interface findOneObjectOptions

    interface findOneObjectOptions {
        projection: object;
    }

    Properties

    Properties

    projection: object

    A NeDB projection object. This is passed along as-is to NeDB, so please refer to their documentation about projections.

    https://github.com/louischatriot/nedb?tab=readme-ov-file#projections

    BigfootDS

    -
    +
    diff --git a/interfaces/Interfaces.updateManyOptions.html b/interfaces/Interfaces.updateManyOptions.html index 7dc1b00..809d20a 100644 --- a/interfaces/Interfaces.updateManyOptions.html +++ b/interfaces/Interfaces.updateManyOptions.html @@ -1,11 +1,11 @@ -updateManyOptions | SuperCamo - v0.4.5

    Interface updateManyOptions

    Configuration object for methods that update many documents at once.

    +updateManyOptions | SuperCamo - v1.0.0

    Interface updateManyOptions

    Configuration object for methods that update many documents at once.

    BigfootDS

    -
    interface updateManyOptions {
        limit: number;
        upsert: boolean;
    }

    Properties

    interface updateManyOptions {
        limit: number;
        upsert: boolean;
    }

    Properties

    Properties

    limit: number

    A number to limit how many documents should be updated during an updateMany operation.

    BigfootDS

    -
    upsert: boolean

    During the requested update operation, if no document already exists that matches the query, this controls whether or not a new document should be created. +

    upsert: boolean

    During the requested update operation, if no document already exists that matches the query, this controls whether or not a new document should be created. If true: a new document is created. If false: no new document is created.

    BigfootDS

    -
    +
    diff --git a/interfaces/Interfaces.updateOptions.html b/interfaces/Interfaces.updateOptions.html index 04ef144..213cf85 100644 --- a/interfaces/Interfaces.updateOptions.html +++ b/interfaces/Interfaces.updateOptions.html @@ -1,8 +1,8 @@ -updateOptions | SuperCamo - v0.4.5

    Interface updateOptions

    Configuration object for methods that update a singular document at a time.

    +updateOptions | SuperCamo - v1.0.0

    Interface updateOptions

    Configuration object for methods that update a singular document at a time.

    BigfootDS

    -
    interface updateOptions {
        upsert: boolean;
    }

    Properties

    interface updateOptions {
        upsert: boolean;
    }

    Properties

    Properties

    upsert: boolean

    During the requested update operation, if no document already exists that matches the query, this controls whether or not a new document should be created. If true: a new document is created. If false: no new document is created.

    BigfootDS

    -
    +
    diff --git a/modules/Classes.html b/modules/Classes.html index af85956..59a191f 100644 --- a/modules/Classes.html +++ b/modules/Classes.html @@ -1,4 +1,4 @@ -Classes | SuperCamo - v0.4.5

    Module Classes

    These classes will be the most-common thing you'll interact with when using this package.

    +Classes | SuperCamo - v1.0.0

    Module Classes

    These classes will be the most-common thing you'll interact with when using this package.

    Typically, you'd be using the SuperCamo singleton class for its static methods and defining your own document models by inheriting from NedbDocument and NedbEmbeddedDocument classes.

    NodeJS CommonJS import:

    const {SuperCamo} = require("@bigfootds/supercamo");
    SuperCamo.clientConnect(/* params go here */); @@ -11,11 +11,11 @@
    -

    Index

    Classes

    Index

    Classes

    +
    diff --git a/modules/Error_Classes.html b/modules/Error_Classes.html index 9fceb76..ff6184f 100644 --- a/modules/Error_Classes.html +++ b/modules/Error_Classes.html @@ -1,4 +1,4 @@ -Error Classes | SuperCamo - v0.4.5

    Module Error Classes

    Index

    Classes

    CollectionAccessError +Error Classes | SuperCamo - v1.0.0
    +
    diff --git a/modules/Interfaces.html b/modules/Interfaces.html index ce81efb..15d45e9 100644 --- a/modules/Interfaces.html +++ b/modules/Interfaces.html @@ -1,6 +1,6 @@ -Interfaces | SuperCamo - v0.4.5

    Module InterfacesInterface

    The core properties of any type of document used in SuperCamo.

    +Interfaces | SuperCamo - v1.0.0

    Module InterfacesInterface

    The core properties of any type of document used in SuperCamo.

    BigfootDS

    -

    Index

    Interfaces

    Index

    Interfaces

    +
    diff --git a/modules/Logging.html b/modules/Logging.html index 837f7a3..fc42796 100644 --- a/modules/Logging.html +++ b/modules/Logging.html @@ -1,4 +1,4 @@ -Logging | SuperCamo - v0.4.5

    Module Logging

    Configured logging system for the SuperCamo package.

    +Logging | SuperCamo - v1.0.0

    Module Logging

    Configured logging system for the SuperCamo package.

    This is not something for users of the SuperCamo package to directly use. Instead, this is something impacted by usage of the NODE_DEBUG environment variable.

    For example, if you want logging from multiple packages, including SuperCamo, you may want to set NODE_DEBUG to be or include "verbose". This would enable multiple packages to log. But if you only want SuperCamo to log, and not any other packages, you may want to set NODE_DEBUG to be or include "supercamo".

    @@ -13,5 +13,5 @@

    Index

    Functions

    +

    Index

    Functions

    diff --git a/modules/Package_Exports.html b/modules/Package_Exports.html index 9992a5f..7c3a4b7 100644 --- a/modules/Package_Exports.html +++ b/modules/Package_Exports.html @@ -1,4 +1,4 @@ -Package Exports | SuperCamo - v0.4.5

    Module Package Exports

    This is the content that you can import in your own code.

    +Package Exports | SuperCamo - v1.0.0

    Module Package Exports

    This is the content that you can import in your own code.

    NodeJS CommonJS import:

    const {NedbClient, SuperCamo} = require("@bigfootds/supercamo");
     
    @@ -10,11 +10,11 @@
    import {SuperCamo} from "@bigfootds/supercamo";
     
    -

    References

    References

    Re-exports CollectionAccessor
    Re-exports CollectionListEntry
    Renames and re-exports Error Classes
    Re-exports NedbClient
    Re-exports NedbDocument
    Re-exports NedbEmbeddedDocument
    Re-exports SuperCamo
    +

    References

    Re-exports CollectionAccessor
    Re-exports CollectionListEntry
    Renames and re-exports Error Classes
    Re-exports NedbClient
    Re-exports NedbDocument
    Re-exports NedbEmbeddedDocument
    Re-exports SuperCamo
    diff --git a/sitemap.xml b/sitemap.xml index 493ad99..9b4c54c 100644 --- a/sitemap.xml +++ b/sitemap.xml @@ -2,210 +2,210 @@ https://bigfootds.github.io/supercamo/index.html - 2024-09-26T01:50:40.391Z + 2024-09-26T01:52:39.134Z https://bigfootds.github.io/supercamo/hierarchy.html - 2024-09-26T01:50:40.391Z + 2024-09-26T01:52:39.134Z https://bigfootds.github.io/supercamo/documents/Quick_Start.html - 2024-09-26T01:50:40.391Z + 2024-09-26T01:52:39.134Z https://bigfootds.github.io/supercamo/documents/The_Basics.html - 2024-09-26T01:50:40.391Z + 2024-09-26T01:52:39.134Z https://bigfootds.github.io/supercamo/documents/The_Basics.00___Understanding_This_Package.html - 2024-09-26T01:50:40.391Z + 2024-09-26T01:52:39.134Z https://bigfootds.github.io/supercamo/documents/The_Basics.01___The_SuperCamo_Singleton.html - 2024-09-26T01:50:40.391Z + 2024-09-26T01:52:39.134Z https://bigfootds.github.io/supercamo/documents/The_Basics.02___Document_Basics.html - 2024-09-26T01:50:40.391Z + 2024-09-26T01:52:39.134Z https://bigfootds.github.io/supercamo/documents/The_Basics.03___Embedded_Document_Basics.html - 2024-09-26T01:50:40.391Z + 2024-09-26T01:52:39.134Z https://bigfootds.github.io/supercamo/documents/The_Basics.04___DB_Client_Basics.html - 2024-09-26T01:50:40.391Z + 2024-09-26T01:52:39.134Z https://bigfootds.github.io/supercamo/documents/Tips___Tricks.html - 2024-09-26T01:50:40.391Z + 2024-09-26T01:52:39.134Z https://bigfootds.github.io/supercamo/modules/Classes.html - 2024-09-26T01:50:40.391Z + 2024-09-26T01:52:39.134Z https://bigfootds.github.io/supercamo/classes/Classes.CollectionAccessor.html - 2024-09-26T01:50:40.391Z + 2024-09-26T01:52:39.134Z https://bigfootds.github.io/supercamo/classes/Classes.CollectionListEntry.html - 2024-09-26T01:50:40.391Z + 2024-09-26T01:52:39.134Z https://bigfootds.github.io/supercamo/classes/Classes.NedbBaseDocument.html - 2024-09-26T01:50:40.391Z + 2024-09-26T01:52:39.134Z https://bigfootds.github.io/supercamo/classes/Classes.NedbClient.html - 2024-09-26T01:50:40.391Z + 2024-09-26T01:52:39.134Z https://bigfootds.github.io/supercamo/classes/Classes.NedbDocument.html - 2024-09-26T01:50:40.391Z + 2024-09-26T01:52:39.134Z https://bigfootds.github.io/supercamo/classes/Classes.NedbEmbeddedDocument.html - 2024-09-26T01:50:40.391Z + 2024-09-26T01:52:39.134Z https://bigfootds.github.io/supercamo/classes/Classes.SuperCamo.html - 2024-09-26T01:50:40.391Z + 2024-09-26T01:52:39.134Z https://bigfootds.github.io/supercamo/modules/Error_Classes.html - 2024-09-26T01:50:40.391Z + 2024-09-26T01:52:39.134Z https://bigfootds.github.io/supercamo/classes/Error_Classes.CollectionAccessError.html - 2024-09-26T01:50:40.391Z + 2024-09-26T01:52:39.134Z https://bigfootds.github.io/supercamo/classes/Error_Classes.DeleteFailure.html - 2024-09-26T01:50:40.391Z + 2024-09-26T01:52:39.134Z https://bigfootds.github.io/supercamo/classes/Error_Classes.PostDeleteFailure.html - 2024-09-26T01:50:40.391Z + 2024-09-26T01:52:39.134Z https://bigfootds.github.io/supercamo/classes/Error_Classes.PostSaveFailure.html - 2024-09-26T01:50:40.391Z + 2024-09-26T01:52:39.134Z https://bigfootds.github.io/supercamo/classes/Error_Classes.PostValidationFailure.html - 2024-09-26T01:50:40.391Z + 2024-09-26T01:52:39.134Z https://bigfootds.github.io/supercamo/classes/Error_Classes.PreDeleteFailure.html - 2024-09-26T01:50:40.391Z + 2024-09-26T01:52:39.134Z https://bigfootds.github.io/supercamo/classes/Error_Classes.PreSaveFailure.html - 2024-09-26T01:50:40.391Z + 2024-09-26T01:52:39.134Z https://bigfootds.github.io/supercamo/classes/Error_Classes.PreValidationFailure.html - 2024-09-26T01:50:40.391Z + 2024-09-26T01:52:39.134Z https://bigfootds.github.io/supercamo/classes/Error_Classes.SaveFailure.html - 2024-09-26T01:50:40.391Z + 2024-09-26T01:52:39.134Z https://bigfootds.github.io/supercamo/classes/Error_Classes.ValidationFailure.html - 2024-09-26T01:50:40.391Z + 2024-09-26T01:52:39.134Z https://bigfootds.github.io/supercamo/classes/Error_Classes.ValidationFailureMinMaxError.html - 2024-09-26T01:50:40.391Z + 2024-09-26T01:52:39.134Z https://bigfootds.github.io/supercamo/classes/Error_Classes.ValidationFailureMissingValueForProperty.html - 2024-09-26T01:50:40.391Z + 2024-09-26T01:52:39.134Z https://bigfootds.github.io/supercamo/classes/Error_Classes.ValidationFailureMissingValueForReferencedDoc.html - 2024-09-26T01:50:40.391Z + 2024-09-26T01:52:39.134Z https://bigfootds.github.io/supercamo/classes/Error_Classes.ValidationFailureReferenceWithoutDatabase.html - 2024-09-26T01:50:40.391Z + 2024-09-26T01:52:39.134Z https://bigfootds.github.io/supercamo/classes/Error_Classes.ValidationFailureUnexpectedProperty.html - 2024-09-26T01:50:40.391Z + 2024-09-26T01:52:39.134Z https://bigfootds.github.io/supercamo/classes/Error_Classes.ValidationFailureValueNotInChoices.html - 2024-09-26T01:50:40.391Z + 2024-09-26T01:52:39.134Z https://bigfootds.github.io/supercamo/modules/Interfaces.html - 2024-09-26T01:50:40.391Z + 2024-09-26T01:52:39.134Z https://bigfootds.github.io/supercamo/interfaces/Interfaces.BaseDocument.html - 2024-09-26T01:50:40.391Z + 2024-09-26T01:52:39.134Z https://bigfootds.github.io/supercamo/interfaces/Interfaces.CollectionAccessor.html - 2024-09-26T01:50:40.391Z + 2024-09-26T01:52:39.134Z https://bigfootds.github.io/supercamo/interfaces/Interfaces.CollectionsListEntry.html - 2024-09-26T01:50:40.391Z + 2024-09-26T01:52:39.134Z https://bigfootds.github.io/supercamo/interfaces/Interfaces.DocumentBaseData.html - 2024-09-26T01:50:40.391Z + 2024-09-26T01:52:39.134Z https://bigfootds.github.io/supercamo/interfaces/Interfaces.DocumentConstructorData.html - 2024-09-26T01:50:40.391Z + 2024-09-26T01:52:39.134Z https://bigfootds.github.io/supercamo/interfaces/Interfaces.DocumentKeyRule.html - 2024-09-26T01:50:40.391Z + 2024-09-26T01:52:39.134Z https://bigfootds.github.io/supercamo/interfaces/Interfaces.DocumentObjectData.html - 2024-09-26T01:50:40.391Z + 2024-09-26T01:52:39.134Z https://bigfootds.github.io/supercamo/interfaces/Interfaces.findManyDocumentsOptions.html - 2024-09-26T01:50:40.391Z + 2024-09-26T01:52:39.134Z https://bigfootds.github.io/supercamo/interfaces/Interfaces.findManyObjectsOptions.html - 2024-09-26T01:50:40.391Z + 2024-09-26T01:52:39.134Z https://bigfootds.github.io/supercamo/interfaces/Interfaces.findOneObjectOptions.html - 2024-09-26T01:50:40.391Z + 2024-09-26T01:52:39.134Z https://bigfootds.github.io/supercamo/interfaces/Interfaces.NedbClientEntry.html - 2024-09-26T01:50:40.391Z + 2024-09-26T01:52:39.134Z https://bigfootds.github.io/supercamo/interfaces/Interfaces.updateManyOptions.html - 2024-09-26T01:50:40.391Z + 2024-09-26T01:52:39.134Z https://bigfootds.github.io/supercamo/interfaces/Interfaces.updateOptions.html - 2024-09-26T01:50:40.391Z + 2024-09-26T01:52:39.134Z https://bigfootds.github.io/supercamo/modules/Logging.html - 2024-09-26T01:50:40.391Z + 2024-09-26T01:52:39.134Z https://bigfootds.github.io/supercamo/functions/Logging.SuperCamoLogger.html - 2024-09-26T01:50:40.391Z + 2024-09-26T01:52:39.134Z https://bigfootds.github.io/supercamo/modules/Package_Exports.html - 2024-09-26T01:50:40.391Z + 2024-09-26T01:52:39.134Z