Vietnam

    Nodejs.vn

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Tags
    • Groups
    • Search
    1. Home
    2. trannamit95
    T
    • Profile
    • Following 0
    • Followers 1
    • Topics 20
    • Posts 43
    • Best 1
    • Controversial 0
    • Groups 0

    trannamit95

    @trannamit95

    1
    Reputation
    556
    Profile views
    43
    Posts
    1
    Followers
    0
    Following
    Joined Last Online

    trannamit95 Unfollow Follow

    Best posts made by trannamit95

    • RE: [HELP] Truy vấn database Postgres

      Sequelize co support thang bulkCreate, ban thu xem

      var listData = data.listID.map(item => {
        return {
          id: item,
          content: data.content
        }
      })
      
      This.sequelize.bulkCreate(listData).then((){
        // response
      })
      
      posted in Hỏi Đáp
      T
      trannamit95

    Latest posts made by trannamit95

    • NPM không install dependencies của các nested dependencies

      Chào mọi người,
      Em đang viết 1 cái app nhỏ như 1 dependencies push lên gitlab rồi dùng npm i git+ssh://.. để cài vào main app. Nhưng hiện tại có 1 vấn đề là khi install trên app lớn, npm không install các dependencies của app nhỏ này (khong tao folder node_modules). Em đã thử các version npm khác nhau nhưng vẫn không được. Mong mọi người ai đã từng gặp vấn đề này, trợ giúp e chút.
      Em cảm ơn.

      posted in Hỏi Đáp
      T
      trannamit95
    • RE: [HELP] Truy vấn database Postgres

      Sequelize co support thang bulkCreate, ban thu xem

      var listData = data.listID.map(item => {
        return {
          id: item,
          content: data.content
        }
      })
      
      This.sequelize.bulkCreate(listData).then((){
        // response
      })
      
      posted in Hỏi Đáp
      T
      trannamit95
    • RE: EMFILE: too many open files, uv_resident_set_memory

      @ndaidong Trong code cua em co xai winston de ghi log, khong biet co phai do thang nay gay ra loi ko, vi e thay file log kha lon + phai ghi log nhieu.

      Co cach nao de log nguyen do tai sao gay crash app khong anh ?

      posted in Hỏi Đáp
      T
      trannamit95
    • EMFILE: too many open files, uv_resident_set_memory

      Mọi người cho em hỏi căn nguyên của cái lỗi này cái. Em không biết trong code có chạy cái gì mà dẫn đến như vậy. Em cảm ơn !

      06/08/2017 10:08:44 +08:00: internal/process.js:109
          memoryUsage_(memValues);
          ^
      
      Error: EMFILE: too many open files, uv_resident_set_memory
      
      posted in Hỏi Đáp
      T
      trannamit95
    • [Hỏi] Validation request params and body

      Mọi người cho em hỏi mọi người đang dùng cách gì hay middleware gì đế validation request params and body ?

      posted in Hỏi Đáp
      T
      trannamit95
    • RE: Send SMS với AWS SNS

      @joseph minh co thử r nhưng cũng không dc.

      posted in Hỏi Đáp
      T
      trannamit95
    • Send SMS với AWS SNS

      Chào mọi người!
      Em đang sử dụng SNS để gửi SMS đến 1 số điện thoại, nhưng mà kết quả trả về không báo lỗi nhưng em lại không nhận được message nào đến sdt cả. Mọi người có gợi ý gì không ạ (ví dụ như phải đi verify sdt hay là phải dùng TargetArn...)

      import AWS from 'aws-sdk'
      
      import CONFIG from '../../config/config'
      
      AWS.config.update({
        accessKeyId: CONFIG.AWSId,
        secretAccessKey: CONFIG.AWSSecretKey,
        region: CONFIG.AWSRegion
      });
      
      const SNS = new AWS.SNS();
      
        sendSMS: () => {
          var params = {
            Message: 'this is a test message',
            MessageStructure: 'string',
            PhoneNumber: '84128518xxxx'
          };
      
          SNS.publish(params, function(err, data) {
            if (err) console.log(err, err.stack); // an error occurred
            else     console.log('done: ', data);           // successful response
          });
       }
      

      Kết quả nhận dc:

      done:  { ResponseMetadata: { RequestId: 'ee463d62-d7f4-57ea-af56-6cf9618fc778' },
        MessageId: 'd7efd1db-8300-5aab-b5d0-8040357bba39' }
      
      posted in Hỏi Đáp
      T
      trannamit95
    • Ghi log file với Winston theo thời gian cũ dần

      Chào mọi người!
      Em đang sử dụng Winstonjs để ghi log file. Nhưng default của nó sẽ ghi logs theo thứ tự từ cũ đến mới. Bây giờ em muốn ghi ngược lại để đưa những nội dung mới lên đầu thì phải làm thế nào?
      https://github.com/winstonjs/winston

      Cảm ơn mọi người !

      posted in Hỏi Đáp
      T
      trannamit95
    • RE: Async khi lưu dữ liệu trong Mongoose

      @nmanhit dung thu Promise.all di ban

      var arrPromise = []
      
      for(.. i < category.length ..){
        var newCate = new Category({
          Name: category[i]
        })
      
        arrPromise.push(
          newCate.save()
        )
      }
      
      Promise.all(arrPromise)
      .then(lstCate => {
        var news = new News({
          Name: ..,
          Category: lstCate
        })
      
        return news.save()
      })
      .then(data => {
        console.log('success')
      })
      .catch(err => {
        console.log('err: ', err)
      })
      
      posted in Hỏi Đáp
      T
      trannamit95
    • RE: Tìm Restful API Framework tốt nhất, miễn phí, nguồn mở?

      @kevin3489 cho minh hoi cai Loopback ay dung voi loai db gi v (mongo/postgres..) hay la tat ca? Tks ban !

      posted in Hỏi Đáp
      T
      trannamit95