Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
BeebuddyUtil
/
dma-common-backend
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 21b0df72
authored
Oct 15, 2020
by
Beebuddy Builder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test interface
1 parent
992888d0
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
208 additions
and
2 deletions
dist/src/index.d.ts
src/index.d.ts
dist/src/index.d.ts
View file @
21b0df7
import
{
FilterQuery
,
UpdateQuery
,
FindAndModifyWriteOpResultObject
,
OptionalId
,
ClientSession
,
DeleteWriteOpResultObject
,
UpdateWriteOpResult
}
from
'mongodb'
export
class
Utils
{
export
class
Utils
{
/**
/**
* @description Testasdfasdfasdf
* @description Testasdfasdfasdf
...
@@ -14,7 +17,10 @@ export const ENV = {
...
@@ -14,7 +17,10 @@ export const ENV = {
DB_PASSWORD
:
""
DB_PASSWORD
:
""
}
}
export
const
ConnectMongo
=
{};
export
const
ConnectMongo
=
{
initial
=
async
function
():
void
{},
getDB
=
function
():
InterfaceDBAction
{}
};
class
ServiceData
{
class
ServiceData
{
...
@@ -31,3 +37,99 @@ export const AppApi = {
...
@@ -31,3 +37,99 @@ export const AppApi = {
addGetMethod
:
async
function
(
uri
:
string
,
processor
:
Processor
):
void
{}
,
addGetMethod
:
async
function
(
uri
:
string
,
processor
:
Processor
):
void
{}
,
startApp
:
function
():
void
{}
startApp
:
function
():
void
{}
};
};
/***
*
*
* External class
*/
class
InterfaceDBAction
{
/**
* Select * From
* @param {String} collectionName
* @param {*} queryCondition
* @param {Object} filter
* @returns {Promise<Array>}
*/
async
find
(
collectionName
,
queryCondition
=
{},
filter
=
{})
{
}
/**
* Select * From Where Only One Data
* @param {String} collectionName
* @param {*} queryCondition
*/
async
findOne
(
collectionName
,
queryCondition
=
{})
{
}
/**
* Insert One Data
* @param {String} collectionName
* @param {OptionalId<Object>} data
* @param {ClientSession} session
*/
async
insertOne
(
collectionName
,
data
=
{}
,
session
=
undefined
)
{}
/**
* Update Data
* @param {String} collectionName
* @param {FilterQuery<Object>} queryCondition
* @param {*} updateValue
* @param {ClientSession} session
* @return {UpdateWriteOpResult}
*/
async
updateOne
(
collectionName
,
queryCondition
=
{},
updateValue
=
{},
session
=
undefined
)
{}
/**
* Update Many Data
* @param {String} collectionName
* @param {*} queryCondition
* @param {*} updateValue
* @param {ClientSession} session
*/
async
updateMany
(
collectionName
,
queryCondition
=
{},
updateValue
=
{}
,
session
=
undefined
)
{}
/**
* Delete From
* @param {String} collectionName
* @param {*} queryCondition
* @param {ClientSession} session
*
* @return {DeleteWriteOpResultObject}
*/
async
deleteMany
(
collectionName
,
queryCondition
,
session
=
undefined
)
{}
/**
* @description Find a document and update it in one atomic operation. Requires a write lock for the duration of the operation.
* http://mongodb.github.io/node-mongodb-native/3.3/api/Collection.html#findOneAndUpdate
* @param {String} collectionName
* @param {FilterQuery<Object>} queryCondition
* @param {UpdateQuery<Object>} updateValue
*
* @returns {FindAndModifyWriteOpResultObject<Object>}
*/
async
findOneAndUpdate
(
collectionName
,
queryCondition
=
{},
updateValue
=
{})
{}
/**
* @description https://docs.mongodb.com/manual/reference/operator/aggregation-pipeline
* @param {String} collectionName
* @param {Object[]} pipeline
*/
async
aggregate
(
collectionName
,
pipeline
=
{})
{}
/**
* @returns {ClientSession}
*/
async
CreateSession
(){}
}
\ No newline at end of file
src/index.d.ts
View file @
21b0df7
import
{
FilterQuery
,
UpdateQuery
,
FindAndModifyWriteOpResultObject
,
OptionalId
,
ClientSession
,
DeleteWriteOpResultObject
,
UpdateWriteOpResult
}
from
'mongodb'
export
class
Utils
{
export
class
Utils
{
/**
/**
* @description Testasdfasdfasdf
* @description Testasdfasdfasdf
...
@@ -14,7 +17,10 @@ export const ENV = {
...
@@ -14,7 +17,10 @@ export const ENV = {
DB_PASSWORD
:
""
DB_PASSWORD
:
""
}
}
export
const
ConnectMongo
=
{};
export
const
ConnectMongo
=
{
initial
=
async
function
():
void
{},
getDB
=
function
():
InterfaceDBAction
{}
};
class
ServiceData
{
class
ServiceData
{
...
@@ -31,3 +37,99 @@ export const AppApi = {
...
@@ -31,3 +37,99 @@ export const AppApi = {
addGetMethod
:
async
function
(
uri
:
string
,
processor
:
Processor
):
void
{}
,
addGetMethod
:
async
function
(
uri
:
string
,
processor
:
Processor
):
void
{}
,
startApp
:
function
():
void
{}
startApp
:
function
():
void
{}
};
};
/***
*
*
* External class
*/
class
InterfaceDBAction
{
/**
* Select * From
* @param {String} collectionName
* @param {*} queryCondition
* @param {Object} filter
* @returns {Promise<Array>}
*/
async
find
(
collectionName
,
queryCondition
=
{},
filter
=
{})
{
}
/**
* Select * From Where Only One Data
* @param {String} collectionName
* @param {*} queryCondition
*/
async
findOne
(
collectionName
,
queryCondition
=
{})
{
}
/**
* Insert One Data
* @param {String} collectionName
* @param {OptionalId<Object>} data
* @param {ClientSession} session
*/
async
insertOne
(
collectionName
,
data
=
{}
,
session
=
undefined
)
{}
/**
* Update Data
* @param {String} collectionName
* @param {FilterQuery<Object>} queryCondition
* @param {*} updateValue
* @param {ClientSession} session
* @return {UpdateWriteOpResult}
*/
async
updateOne
(
collectionName
,
queryCondition
=
{},
updateValue
=
{},
session
=
undefined
)
{}
/**
* Update Many Data
* @param {String} collectionName
* @param {*} queryCondition
* @param {*} updateValue
* @param {ClientSession} session
*/
async
updateMany
(
collectionName
,
queryCondition
=
{},
updateValue
=
{}
,
session
=
undefined
)
{}
/**
* Delete From
* @param {String} collectionName
* @param {*} queryCondition
* @param {ClientSession} session
*
* @return {DeleteWriteOpResultObject}
*/
async
deleteMany
(
collectionName
,
queryCondition
,
session
=
undefined
)
{}
/**
* @description Find a document and update it in one atomic operation. Requires a write lock for the duration of the operation.
* http://mongodb.github.io/node-mongodb-native/3.3/api/Collection.html#findOneAndUpdate
* @param {String} collectionName
* @param {FilterQuery<Object>} queryCondition
* @param {UpdateQuery<Object>} updateValue
*
* @returns {FindAndModifyWriteOpResultObject<Object>}
*/
async
findOneAndUpdate
(
collectionName
,
queryCondition
=
{},
updateValue
=
{})
{}
/**
* @description https://docs.mongodb.com/manual/reference/operator/aggregation-pipeline
* @param {String} collectionName
* @param {Object[]} pipeline
*/
async
aggregate
(
collectionName
,
pipeline
=
{})
{}
/**
* @returns {ClientSession}
*/
async
CreateSession
(){}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment