@@ -11,7 +11,8 @@ const v2 = express.Router();
1111v2 . get ( '/caps' , asyncHandle ( async ( req , res ) => {
1212 const data = await global . db
1313 . collection ( 'capsule' )
14- . find ( caps . capsuleQuery ( req ) , { _id : 0 } )
14+ . find ( caps . capsuleQuery ( req ) )
15+ . project ( { _id : 0 } )
1516 . sort ( { capsule_serial : 1 } )
1617 . toArray ( ) ;
1718 res . json ( data ) ;
@@ -21,7 +22,8 @@ v2.get('/caps', asyncHandle(async (req, res) => {
2122v2 . get ( '/caps/:cap' , asyncHandle ( async ( req , res ) => {
2223 const data = await global . db
2324 . collection ( 'capsule' )
24- . find ( { capsule_serial : req . params . cap } , { _id : 0 } )
25+ . find ( { capsule_serial : req . params . cap } )
26+ . project ( { _id : 0 } )
2527 . toArray ( ) ;
2628 res . json ( data [ 0 ] ) ;
2729} ) ) ;
@@ -30,7 +32,8 @@ v2.get('/caps/:cap', asyncHandle(async (req, res) => {
3032v2 . get ( '/cores' , asyncHandle ( async ( req , res ) => {
3133 const data = await global . db
3234 . collection ( 'core' )
33- . find ( cores . coreQuery ( req ) , { _id : 0 } )
35+ . find ( cores . coreQuery ( req ) )
36+ . project ( { _id : 0 } )
3437 . sort ( { core_serial : 1 } )
3538 . toArray ( ) ;
3639 res . json ( data ) ;
@@ -40,7 +43,8 @@ v2.get('/cores', asyncHandle(async (req, res) => {
4043v2 . get ( '/cores/:core' , asyncHandle ( async ( req , res ) => {
4144 const data = await global . db
4245 . collection ( 'core' )
43- . find ( { core_serial : req . params . core } , { _id : 0 } )
46+ . find ( { core_serial : req . params . core } )
47+ . project ( { _id : 0 } )
4448 . toArray ( ) ;
4549 res . json ( data [ 0 ] ) ;
4650} ) ) ;
0 commit comments