Hi,
I want to give feedback here if may I.
I really don’t like how realm is imported and instances are accessed. The deprecated stitch-browser-sdk its much more intuitive and intelisense works great, its a much better experience.
Can you fix it?
example:
import { Injectable } from '@angular/core';
import { JsonConvert } from 'json2typescript';
import { RemoteMongoClient, RemoteMongoDatabase, Stitch, StitchAppClient } from 'mongodb-stitch-browser-sdk';
import { environment } from 'src/environments/environment';
@Injectable()
export class DatabaseService {
client: StitchAppClient;
database: RemoteMongoDatabase;
private jsonConvert: JsonConvert;
constructor() {
this.client = Stitch.initializeAppClient(environment.stitchConfig.clientId);
this.database = this.client
.getServiceClient(RemoteMongoClient.factory, environment.stitchConfig.clusterName)
.db(environment.stitchConfig.databaseName);
this.jsonConvert = new JsonConvert();
}
deserializeObject<T>(jsonObject: any, classReference: any): T {
return this.jsonConvert.deserializeObject(jsonObject, classReference);
}
deserializeArray<T>(jsonArray: any[], classReference: any): T[] {
return this.jsonConvert.deserializeArray(jsonArray, classReference);
}
}
Or will I have to refactor everything?
Kind regards,
Rui Cruz