2022-09-08 08:58:39 -07:00
|
|
|
import mongoose from 'mongoose'
|
2025-05-16 07:52:58 -07:00
|
|
|
// import config from '../../config/index.js'
|
|
|
|
|
import User from '../../../src/adapters/localdb/models/users.js'
|
|
|
|
|
|
|
|
|
|
const mongooseConnectStr = 'mongodb://172.17.0.1:5666/bch-swap-service-prod'
|
2021-04-09 08:39:53 -07:00
|
|
|
|
|
|
|
|
async function getUsers () {
|
|
|
|
|
// Connect to the Mongo Database.
|
|
|
|
|
mongoose.Promise = global.Promise
|
|
|
|
|
mongoose.set('useCreateIndex', true) // Stop deprecation warning.
|
|
|
|
|
await mongoose.connect(
|
2025-05-16 07:52:58 -07:00
|
|
|
mongooseConnectStr,
|
2021-04-09 08:39:53 -07:00
|
|
|
{ useNewUrlParser: true, useUnifiedTopology: true }
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
const users = await User.find({}, '-password')
|
|
|
|
|
console.log(`users: ${JSON.stringify(users, null, 2)}`)
|
|
|
|
|
|
|
|
|
|
mongoose.connection.close()
|
|
|
|
|
}
|
|
|
|
|
getUsers()
|