Dynamo DB + In put Item Request how to pass null value?

I just pass nulls. Here's my NodeJS script for loading data from file into DynamoDB, I just use ternaries to avoid empty strings.

var AWS = require("aws-sdk");
var fs = require('fs');

// Make sure we got a filename on the command line.
if (process.argv.length < 3) {
  console.log('Usage: node ' + process.argv[1] + ' FILENAME');
  process.exit(1);
}

var filename = process.argv[2];

AWS.config.update({
    region: "us-west-2",
    //endpoint: "http://localhost:8000"
});

var docClient = new AWS.DynamoDB.DocumentClient();

console.log("Importing Addresses into DynamoDB. Please wait.");

var allObjs = JSON.parse(fs.readFileSync(filename, 'utf8'));
allObjs.forEach(function(obj) {
    var params = {
        TableName: "Address",
        Item: {
            "address_detail_pid":  obj.address_detail_pid,
            "flat_type":  obj.flat_type == '' ? null : obj.flat_type,
            "flat_number":  obj.flat_number == '' ? null : obj.flat_number,
            "level_type":  obj.level_type == '' ? null : obj.level_type,
            "level_number":  obj.level_number == '' ? null : obj.level_number,
            "number_first":  obj.number_first == '' ? null : obj.number_first,
            "street_name":  obj.street_name == '' ? null : obj.street_name,
            "street_type_code":  obj.street_type_code == '' ? null : obj.street_type_code,
            "locality_name":  obj.locality_name == '' ? null : obj.locality_name,
            "state_abbreviation":  obj.state_abbreviation == '' ? null : obj.state_abbreviation,
            "postcode":  obj.postcode == '' ? null : obj.postcode,
            "longitude":  obj.longitude == '' ? null : obj.longitude,
            "latitude":  obj.latitude == '' ? null : obj.latitude
        }
    };

    docClient.put(params, function(err, data) {
       if (err) {
           console.error("Unable to add obj", obj.address_detail_pid, ". Error JSON:", JSON.stringify(err, null, 2));
       } else {
           console.log("PutItem succeeded:", obj.address_detail_pid);
       }
    });
});

I think the best way is to check if the value of the field is blank and not save the value in the database.

When the field is blank, we should not include it in the attribute value map.

Here is the code snippet I have used in GO language

myAttributeValues := map[string]*dynamodb.AttributeValue{
        “field1”: {
            S: aws.String(value1),
        },
        “field2”: {
            S: aws.String(value2),
        },
        “field3”: {
            S: aws.String(value3),
        },      
    }

    if field4  != "" {
        field4Attribute := dynamodb.AttributeValue{
            S: aws.String(value4),
        }
        myAttributeValues[“field4”] = &field4Attribute
    }

    if field5 != "" {
        field5Attribute := dynamodb.AttributeValue{
            S: aws.String(value5),
        }
        myAttributeValues["field5"] = &field5Attribute
    }

    input := &dynamodb.PutItemInput{

        TableName: aws.String(mytableName),
        Item:      myAttributeValues,
    }

Finally i got this right, The way might be some what different but it work for me !!!

Here is the code for the same.

AttributeUpdates: {
                     Address2: 
                     {
                        Action: "DELETE"
                     },
                  }

And then i am adding the value on the condition.

if (propertyObj.address2) {
        params.AttributeUpdates.address2 = {
            Value: {
                S: propertyObj.address2
            },
            Action: "PUT"
        }
    }

Thank you to all from bottom of my heart :)who tried to help me, Cheers !!!