@@ -39,7 +39,7 @@ module.exports = function(config) {
3939 // property: value
4040 // }
4141 function fromDatastore ( obj ) {
42- obj . data . id = obj . key . path [ obj . key . path . length - 1 ] ;
42+ obj . data . id = obj . key . id ;
4343 return obj . data ;
4444 }
4545
@@ -92,9 +92,9 @@ module.exports = function(config) {
9292 . order ( 'title' )
9393 . start ( token ) ;
9494
95- ds . runQuery ( q , function ( err , entities , cursor ) {
95+ ds . runQuery ( q , function ( err , entities , nextQuery ) {
9696 if ( err ) { return cb ( err ) ; }
97- var hasMore = entities . length === limit ? cursor : false ;
97+ var hasMore = entities . length === limit ? nextQuery . startVal : false ;
9898 cb ( null , entities . map ( fromDatastore ) , hasMore ) ;
9999 } ) ;
100100 }
@@ -108,9 +108,9 @@ module.exports = function(config) {
108108 . limit ( limit )
109109 . start ( token ) ;
110110
111- ds . runQuery ( q , function ( err , entities , cursor ) {
111+ ds . runQuery ( q , function ( err , entities , nextQuery ) {
112112 if ( err ) { return cb ( err ) ; }
113- var hasMore = entities . length === limit ? cursor : false ;
113+ var hasMore = entities . length === limit ? nextQuery . startVal : false ;
114114 cb ( null , entities . map ( fromDatastore ) , hasMore ) ;
115115 } ) ;
116116 }
0 commit comments