FileSystemStore
Store for MongoPortable (https://github.com/EastolfiWebDev/MongoPortable)
Kind: global class
Since: 0.0.1
- FileSystemStore
- new FileSystemStore([options])
- instance
- inner
- ~createCollection(event) ⇒
boolean
|Promise.<boolean>
- ~insert(event) ⇒
boolean
|Promise.<boolean>
- ~find(event) ⇒
Object
|Promise.<Object>
- ~findOne(event) ⇒
Object
|Promise.<Object>
- ~update(event) ⇒
boolean
|Promise.<boolean>
- ~remove(event) ⇒
boolean
|Promise.<boolean>
- ~createCollection(event) ⇒
new FileSystemStore([options])
FileSystemStore
Param | Type | Default | Description |
---|---|---|---|
[options] | Object |
Additional options | |
[options.ddbb_path] | Boolean |
"db" |
The name of the directory where the database will be located |
[options.sync] | Boolean |
true |
Set it false to make all the file access asynchronous. (Currently only sync=true is supported) |
[options.collection_extension] | Boolean |
"json" |
The extension of the collection files. (Currently only "json" is supported) |
fileSystemStore.getCollectionPath(ddbb_name, coll_name) ⇒ String
Get the path of the collection file
Kind: instance method of FileSystemStore
Returns: String
- - The path of the file
Param | Type | Description |
---|---|---|
ddbb_name | String |
Name of the database |
coll_name | String |
Name of the collection |
FileSystemStore~createCollection(event) ⇒ boolean
| Promise.<boolean>
Receives a "createCollection" event from MongoPortable, syncronizing the collection file with the new info
Kind: inner method of FileSystemStore
Returns: boolean
| Promise.<boolean>
- - True if the collection was created
Param | Type | Description |
---|---|---|
event | Object |
Information of the event |
event.connection | Object |
Information about the current database connection |
event.collection | Object |
Information about the collection created |
FileSystemStore~insert(event) ⇒ boolean
| Promise.<boolean>
Receives a "insert" event from MongoPortable, syncronizing the collection file with the new info
Kind: inner method of FileSystemStore
Returns: boolean
| Promise.<boolean>
- - True if the collection was inserted
Param | Type | Description |
---|---|---|
event | Object |
Arguments from the event |
event.collection | Object |
Information about the collection |
event.doc | Object |
Information about the document inserted |
FileSystemStore~find(event) ⇒ Object
| Promise.<Object>
Receives a "find" event from MongoPortable, fetching the info of the collection file
Kind: inner method of FileSystemStore
Returns: Object
| Promise.<Object>
- - An object with the document and indexes
Param | Type | Description |
---|---|---|
event | Object |
Arguments from the event |
Properties
Name | Type | Description |
---|---|---|
event.collection | Object |
Information about the collection |
event.selector | Object |
The selection of the query |
event.fields | Object |
The fields showed in the query |
FileSystemStore~findOne(event) ⇒ Object
| Promise.<Object>
Receives a "findOne" event from MongoPortable, fetching the info of the collection file
Kind: inner method of FileSystemStore
Returns: Object
| Promise.<Object>
- - An object with the document and indexes
Param | Type | Description |
---|---|---|
event | Object |
Arguments from the event |
Properties
Name | Type | Description |
---|---|---|
event.collection | Object |
Information about the collection |
event.selector | Object |
The selection of the query |
event.fields | Object |
The fields showed in the query |
FileSystemStore~update(event) ⇒ boolean
| Promise.<boolean>
Receives an "update" event from MongoPortable, syncronizing the collection file with the new info
Kind: inner method of FileSystemStore
Returns: boolean
| Promise.<boolean>
- - True if the documents were updated
Param | Type | Description |
---|---|---|
event | Object |
Arguments from the event |
Properties
Name | Type | Description |
---|---|---|
event.collection | Object |
Information about the collection |
event.selector | Object |
The selection of the query |
event.modifier | Object |
The modifier used in the query |
event.docs | Object |
The updated/inserted documents information |
FileSystemStore~remove(event) ⇒ boolean
| Promise.<boolean>
Receives an "remove" event from MongoPortable, syncronizing the collection file with the new info
Kind: inner method of FileSystemStore
Returns: boolean
| Promise.<boolean>
- - True if the documents were removed
Param | Type | Description |
---|---|---|
event | Object |
Arguments from the event |
Properties
Name | Type | Description |
---|---|---|
event.collection | Object |
Information about the collection |
event.selector | Object |
The selection of the query |
event.docs | Object |
The deleted documents information |