Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [nodemon] to restart at any time, enter `rs`
- [nodemon] watching: *.*
- [nodemon] starting `node server.js`
- Running on port 3000
- Connection established
- [nodemon] restarting due to changes...
- [nodemon] restarting due to changes...
- [nodemon] starting `node server.js`
- Running on port 3000
- Connection established
- 5c4b294efb654f1770522264
- { _id: 5c4b294efb654f1770522264,
- email: 'dev@dev.com',
- username: 'devbeans',
- password:
- '$2a$10$Gl8uMUy.enGaWnUYmcDRmexj/ITJ0Ys48I4535fjb4GNmRjBeg9wO',
- ethAddress: '0x967bb849e15b26133e98d7a80f7c71636b4c68e8',
- privateKey:
- '774ed5b09062af0fcd7760cd2dd0052ed32f0f8ffd5d5b9062782c568a49c6e0',
- __v: 0 }
- undefined
- POST /api/getTransactions 200 264.266 ms - -
- userId = req.body._id
- console.log(userId)
- //console.log(process.env.NODE_ENV)
- User.findOne({ _id: userId }, function (err, user) {
- console.log(user)
- if (user) {
- console.log(user.transactions)
- res.send(user.transactions)
- } else {
- console.log(err)
- }
- })
- })
- var TransactionSchema = new Schema({
- time: {
- type: String
- },
- date : {
- type: String
- },
- transactionType : {
- type: String
- },
- email : {
- type: String
- },
- amount: {
- type: String
- },
- txHash:{
- type: String
- }
- })
- var UserSchema = new Schema({
- username: {
- type: String
- },
- email: {
- type: String,
- },
- password: {
- type: String
- },
- ethAddress: {
- type: String
- },
- privateKey: {
- type: String
- },
- transactions: TransactionSchema,
- })
Add Comment
Please, Sign In to add comment