41
rated 0 times
[
48]
[
7]
/ answers: 1 / hits: 16876
/ 7 Years ago, fri, may 26, 2017, 12:00:00
I am getting a json response and storing it in mongodb, however the fields that I don't need are also getting in to the database, is there anyway to strip the uneseccary fields?
interface Test{
name:string
};
const temp :Test = JSON.parse('{ name:someName,age:20 }') as Test;
console.log(temp);
output :
{ name: 'someName', age: 20 }
More From » json