i got a model that i use this package
as follow
`
export interface ILocationsModel extends IBaseModel {
lat: number;
long: number;
title: string;
asset_small_image?: string;
subtitle: string;
entity?: DocumentReference<FirebaseFirestore.DocumentData>;
address: string;
owner: DocumentReference<FirebaseFirestore.DocumentData>;
}
export class LocationsModel extends BaseModel {
@IsLatitude()
@IsNumber()
public lat: number;
@IsLongitude()
@IsNumber()
public long: number;
@IsString()
public title: string;
@IsString()
public asset_small_image?: string;
@IsString()
public subtitle: string;
@isObject()
public entity?: DocumentReference<FirebaseFirestore.DocumentData>;
@IsString()
public address: string;
@isObject()
public owner: DocumentReference<FirebaseFirestore.DocumentData>;
constructor(params: ILocationsModel, validate: boolean = true) {
super(params);
this.address = params.address;
this.asset_small_image = params.asset_small_image;
this.entity = params.entity;
this.lat = params.lat;
this.long = params.long;
this.title = params.title;
this.subtitle = params.subtitle;
this.owner = params.owner;
if (validate) {
this.validate();
}
}
}
`
now i try to get the document ref that i need for return as response for a service is there a way fetching the document ref i save at later of db for i don't want duplicates of same data
i got a model that i use this package
as follow
`
export interface ILocationsModel extends IBaseModel {
lat: number;
long: number;
title: string;
asset_small_image?: string;
subtitle: string;
entity?: DocumentReference<FirebaseFirestore.DocumentData>;
address: string;
owner: DocumentReference<FirebaseFirestore.DocumentData>;
}
export class LocationsModel extends BaseModel {
@IsLatitude()
@IsNumber()
public lat: number;
@IsLongitude()
@IsNumber()
public long: number;
@IsString()
public title: string;
@IsString()
public asset_small_image?: string;
@IsString()
public subtitle: string;
@isObject()
public entity?: DocumentReference<FirebaseFirestore.DocumentData>;
@IsString()
public address: string;
@isObject()
public owner: DocumentReference<FirebaseFirestore.DocumentData>;
}
`
now i try to get the document ref that i need for return as response for a service is there a way fetching the document ref i save at later of db for i don't want duplicates of same data