ngOnInit()

in app/src/app/pages/explore/explore.component.ts [42:78]


  ngOnInit() {
    this.mongoDb.isReadOnly().subscribe(({ readOnly }) => {
      this.readOnly = readOnly;
    });
    combineLatest(
      this.activatedRoute.paramMap,
      this.activatedRoute.queryParamMap
    ).subscribe(([params, queryParams]) => {
      this.server     = params.get('server');
      this.database   = params.get('database');
      this.collection = params.get('collection');

      let query;
      let sort;
      let limit;
      let skip;
      let project;
      if (queryParams.has('query')) {
        query = queryParams.get('query');
      }
      if (queryParams.has('project')) {
        project = queryParams.get('project');
      }
      if (queryParams.has('sort')) {
        sort = queryParams.get('sort');
      }
      if (queryParams.has('skip')) {
        skip = parseInt(queryParams.get('skip'), 10);
      }
      if (queryParams.has('limit')) {
        limit = parseInt(queryParams.get('limit'), 10);
      }
      this.params = {
        query, sort, limit, skip, project
      };
    });
  }