Sample log data for z/TPF support for MongoDB

The examples in this information show the log data for requests that insert and remove a document. These examples are based on the PNR file example that is described in An example of a z/TPF file.
  • The following examples show the log data for a request that inserts a document into the PNR collection with the BINARY parameter specified on the ZMONG LOG SET command for the PNR collection.
    The following example shows the header document. The header document does not have an algorithm string because no query document was specified in the insert() request.
    "header":{  
       "procId":"B",  
       "tenant":"HPN ",  
       "user":"Mike",  
       "reqAct":"insert",  
       "reqTime":"2018-03-31 19:17:06.282670",  
       "reqTod":"80457103967", 
       "reqDur":1560,  
       "tpfHost:”9.57.13.99”,  
       "userIP":"9.12.80.181",  
       "lPort":27017,  
       "rPort":61808,  
       "algLen":0,  
       "algStr":{"$binary":"","$type":"generic"},
       "objId":{"$oid":"0000000000000000180e9b14"}
    }
    The following example shows the request document. The request document in the log data is a replica of the actual request that is received from a MongoDB remote client. The PNR includes a passenger name record, an address record, and a flight history record. The request document also includes an index, PnrByName.
    "req":{  
        "type":"query",  
        "fullCollectionName":"tpfdf.$cmd",  
        "query":{
           "insert":"PNR",
           "documents":[ 
              {             
                  "_id":{"$oid":"57a8cd0a2553fabcf645bf08"},            
                  "_index":{"PnrByName":{"name":"ZZSMITH"}},
    			  "PassengerNumberRecord":[{"PassengerNumber":100}]
    			  "AddressRecord":[{"Address":"267 Jordan Blvd, LasVegas, Nevada 58521"}],
    			  "FlightHistoryRecord":[
        	    	 {
    				    "Spare":"\u0000",
    					"FlightInfo":{
    					"Flight":{
    					   "FlightDate":1.0,
    					   "FlightNumber":"10"
    					   },
    					"Origin":"ALD",
    					"Destination":"TDE"}
    			      }
    		      ]
         	  }
    	   ],
    	   "ordered":true}
    }
            
    The following example shows the reply document. The reply document is a replica of the reply that the z/TPF system sends back to the MongoDB remote client.
    "rep": {
        "ok":1, 
        "n":1
    }
    The following example shows the binary data document. The binary data document in the log data has an entry for each operation that the z/TPF system performs to complete the request. The following example contains the following entries:
    • One for each LREC that was added to the created subfile.
    • One for the index that was specified in the request.
    • One for an index that was created as a result of the automatic indexing option that is defined for the PNR collection. The PNR is automatically indexed by the PNR number record.
    "binary":[
           {
                "operation":"INSERT",
                "dataLength":28,
                "data":{"$binary":"001c80e9e9e2d4c9e3c8404040404040404040404040404040404040",
                           "$type":"generic"}
           },
           {
                "operation":"INSERT",
                "dataLength":43,
                "data":{"$binary":"002b90f2f6f740d1969984819540c293a5846b40d381a2e5858781a26b40d585a58184814040f5f8f5f2f1",
                           "$type":"generic"}
           },
           {
                "operation":"INSERT",
                "dataLength":15,
                "data":{"$binary":"000fa0000001f1f040c1d3c4e3c4c5","$type":"generic"}
           },
           {
                "operation":"INDEX",
                "dataLength":33,
                "data":{"$binary":"e9e9d4c9e3c8404040404040404040404040404040404040400000000000000000", 
                           "$type":"generic"}
           },
           {
                "operation":"INDEX",
                "dataLength":33,
                "data":{"$binary":"e9e9e2d4c9e3c84040404040404040404040404040404040400000000000000000", 
                           "$type":"generic"}
           }
       ]
    
    
  • The following examples show the log data for a request that removes a document from the PNR collection:
    The following example shows the header document:
    "header":{  
       "procId":"B",  
       "tenant":"HPN ",  
       "user":"Mike",  
       "reqAct":"remove",  
       "reqTime":"2018-03-31 19:22:30.586026",  
       "reqTod":"80457103967", 
       "reqDur":2399,  
       "userIP":"9.12.80.181",  
       "lPort":27017,  
       "rPort":61808,  
       "algLen":33,  
       "algStr":{"$binary":"e9e9e2d4c9e3c84040404040404040404040404040404040400000000000000000",
                    "$type":"generic"}, 
       "objId":{"$oid":"0000000000000000180e9b14"}
    }
    The following example shows the request document:
    "req":{  
        "type":"query",  
        "fullCollectionName":"tpfdf.$cmd",  
    	"query":{
           "delete":"PNR",     
           "deletes":[{"q":{"_index":{"PnrByName":{"name":"ZZSMITH"}}},"limit":0.0}],
           "ordered":true}
    }
    The following example shows the reply document:
    "rep":{
        "ok":1,
        "n":1
    }
    The following example shows the binary data document. The binary document does not include the LRECs that are removed, but it shows the deindex operation that is performed to remove the document:
    "binary":[ 
      {
         "operation":"DEINDEX",
         "dataLength":33,    
         "data":{"$binary":"e9e9e2d4c9e3c84040404040404040404040404040404040400000000000000000",
                    "$type":"generic"}
      }, 
      {
         "operation":"DEINDEX",  
         "dataLength":33,
         "data":{"$binary":"e9e9e2d4c9e3c84040404040404040404040404040404040400000000000000000",
                    "$type":"generic"}
      }
    ]