UNPKG
node-tenancy
Version:
beta (1.2.2-beta.0)
latest (1.2.5)
1.2.5
1.2.3
1.2.2
1.2.2-beta.0
1.2.1
1.2.1-beta.3
1.2.1-beta.2
1.2.1-beta.1
1.2.1-beta.0
1.2.0
1.1.2-beta.4
1.1.2-beta.3
1.1.2-beta.2
1.1.2-beta.1
1.1.2-beta.0
1.1.1
1.1.0
1.0.4
1.0.3
1.0.1
1.0.0
Making multi-tenancy easier with Node.js & typescript
github.com/johnabil/tenancy
johnabil/tenancy
node-tenancy
/
examples
/
bun-app
/
controllers
/
UserController.ts
11 lines
(9 loc)
•
284 B
text/typescript
View Raw
1
2
3
4
5
6
7
8
9
10
11
import
{config, db}
from
"node-tenancy"
export
function
getUsersCount
(
) {
return
db.
getModel
(
'User'
).
countDocuments
().
then
(
(
usersCount: any
) =>
{
return
{
'tenant_id'
: config.
getConfig
()?.
tenant_id
,
'users_count'
: usersCount, }; }); }