asked    Janet     2018-07-04       mongodb       234 view        2 Answers

[SOLVED] Mongodb getting error while creating new user

I just installed a fresh mongodb on Ubuntu server and when i try to adduser i am getting error

db.createUser(
  {
    user: "admin",
    pwd: "ADYkdfd332@@33",
    roles: [ { role: "userAdminAnyDatabase", db: "admin" } ]
  }
)


2018-07-03T13:29:41.556+0530 E QUERY    [thread1] Error: couldn't add user: Use of SCRAM-SHA-256 requires undigested passwords :
_getErrorWithCode@src/mongo/shell/utils.js:25:13
DB.prototype.createUser@src/mongo/shell/db.js:1437:15
@(shell):1:1

  2 Answers  

        answered    Noel     2018-07-04      

If you use User Management Methods you have to set param passwordDigestor.

 db.createUser(
  {
    user: "admin",
    pwd: "ADYkdfd332@@33",
    roles: [ { role: "userAdminAnyDatabase", db: "admin" } ],
    passwordDigestor: "<server|client>"
  }
)


        answered    Vic     2018-07-04      

See the SCRAM-SHA-256 password creation with digest or undigest here

db.createUser(
  {
    user: "admin",
    pwd: "ADYkdfd332@@33",
    roles: [ { role: "userAdminAnyDatabase", db: "admin" } ],
    digestPassword : true //if version 4.0 else set it false
  }
)




Your Answer





 2018-07-04         Eudora

Angular 5 - Loading Script After View Is Loaded

I have a legacy script that I need to include in my angular application.The thing about this script is that it relates to a specific component, and it has to be loaded only after the view of the component is loaded.As for today, I succeeded to include it on OnInit function but sometimes (not always for some reason) the CLI throws an error about it.import { Component, OnInit } from '@angular/core';@Component({ selector: 'app-player-page', templateUrl: './player-page.component.html', styleUrls: ['./player-page.component.scss']})export class PlayerPageComponent implements O...
 javascript                     1 answers                     76 view
 2018-07-04         Adolph

Angular RxJS Nested Subscribe with multiple Http Requests

I would like to know what is the best practice when making http request one after another, especially, I'll be required to use the return value from the first request. Currently, I've a nested subscription to achieve this issue [See the code below]. I tried with siwtchMap, mergeMap & concat from RxJS, but it didn't seem to work. Any suggestion will be help for. onStartUp() { this.recordingService.getRecording(this.id) .subscribe(x => { this.recording = x; const params = new Chunk(this.recording, 0, 30); this.recordingService.getSignal(params)...
 angular                     2 answers                     79 view
 2018-07-04         Irma

why i am getting undefined state initially in angular

I am using redux in àngular using ngrx .but i am getting undefined value initially why here is my code don't run this on chrome (issue in stackblitz in chrome browser ) Please use other browser.https://stackblitz.com/edit/angular-sz7rul?file=src%2Fapp%2Findex.tsconst getProductFeatureState =createFeatureSelector<fromProduct.ProductState>('productFeature')export const getProducts = createSelector( getProductFeatureState, state => { console.log(state); return state.products });i am printing my state it is giving me undefined .please help .Inspect the element...
 angular                     2 answers                     80 view