private Observable < Record > setDocumentInRecord ( Record record , JsonDocument doc ) { if ( doc . content ( ) == null ) { LOG . debug ( "Document does not exist: {}" , doc . id ( ) ) ; return handleError ( record , Errors . COUCHBASE_26 , true ) ; } try { record . set ( config . outputField , jsonToField ( doc . content ( ) . toMap ( ) ) ) ; record . getHeader ( ) . setAttribute ( config . CAS_HEADER_ATTRIBUTE , String . valueOf ( doc . cas ( ) ) ) ; return Observable . just ( record ) ; } catch ( IOException e ) { LOG . debug ( "Unable to set KV lookup in record for: {}" , doc . id ( ) ) ; return handleError ( record , Errors . COUCHBASE_19 , e , false ) ; } }
Writes full document lookup values to the record