-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9b341fe
commit 275225a
Showing
4 changed files
with
30 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
{ | ||
"enabled": false | ||
"enabled": true, | ||
"mongo_service_name": "mongodb-atlas", | ||
"database_name": "db", | ||
"collection_name": "Database", | ||
"user_id_field": "Clusters", | ||
"on_user_creation_function_name": "onUserCreation" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,5 +2,9 @@ | |
{ | ||
"name": "resetFunc", | ||
"private": true | ||
}, | ||
{ | ||
"name": "onUserCreation", | ||
"private": false | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* | ||
This function will run after a user is created and is called with an object representing that user. | ||
This function runs as a System user and has full access to Services, Functions, and MongoDB Data. | ||
Example below: | ||
exports = (user) => { | ||
// use collection that Custom User Data is configured on | ||
const collection = context.services.get("<SERVICE_NAME>").db("<DB_NAME>").collection("<COLL_NAME>"); | ||
// insert custom data into collection, using the user id field that Custom User Data is configured on | ||
const doc = collection.insertOne({ <USER_ID_FIELD>: user.id, name: user.data.name }); | ||
}; | ||
*/ | ||
|
||
exports = (user) => { | ||
return; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"dependencies":{"Npm":"3.0.0"}} |