Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

One or more parameter values were invalid: ComparisonOperator BETWEEN is not valid for M AttributeValue type #30

Open
kashifaliquazi opened this issue Jan 7, 2019 · 3 comments

Comments

@kashifaliquazi
Copy link

I am integrating this Library with my Lambda function written in node.js.

Here is my code

`const AWS = require('aws-sdk');
const ddbGeo = require('dynamodb-geo');

const MESSAGES_TABLE = process.env.MESSAGES_TABLE;
const AWS_DEPLOY_REGION = process.env.AWS_DEPLOY_REGION;

const dynamoDb = new AWS.DynamoDB.DocumentClient({
api_version: '2012-08-10',
region: AWS_DEPLOY_REGION
});

const config = new ddbGeo.GeoDataManagerConfiguration(dynamoDb, MESSAGES_TABLE);
const myGeoTableManager = new ddbGeo.GeoDataManager(config);

//and here is my Lambda function

module.exports.fetchNearByUsers = async (event, context) => {
const params = {
TableName: MESSAGES_TABLE
};
try {
return myGeoTableManager.queryRadius({
RadiusInMeter: 100000,
CenterPoint: {
latitude: 52.225730,
longitude: 0.149593
}
})
} catch (error) {
return {
statusCode: 400,
error: Could not fetch: ${error.stack}
};
}
};`

Whenever I test my Lambda Function from AWS console. I am getting this error.

{
"errorMessage": "One or more parameter values were invalid: ComparisonOperator BETWEEN is not valid for M AttributeValue type",
"errorType": "ValidationException",
"stackTrace": [
"Request.extractError (/var/runtime/node_modules/aws-sdk/lib/protocol/json.js:48:27)",
"Request.callListeners (/var/runtime/node_modules/aws-sdk/lib/sequential_executor.js:105:20)",
"Request.emit (/var/runtime/node_modules/aws-sdk/lib/sequential_executor.js:77:10)",
"Request.emit (/var/runtime/node_modules/aws-sdk/lib/request.js:683:14)",
"Request.transition (/var/runtime/node_modules/aws-sdk/lib/request.js:22:10)",
"AcceptorStateMachine.runTo (/var/runtime/node_modules/aws-sdk/lib/state_machine.js:14:12)",
"/var/runtime/node_modules/aws-sdk/lib/state_machine.js:26:10",
"Request. (/var/runtime/node_modules/aws-sdk/lib/request.js:38:9)",
"Request. (/var/runtime/node_modules/aws-sdk/lib/request.js:685:12)",
"Request.callListeners (/var/runtime/node_modules/aws-sdk/lib/sequential_executor.js:115:18)"
]
}

@kashifaliquazi
Copy link
Author

@rh389 Hi, Can you please look into the Issue.
Any help would be appreciated . :)

@jadamsdb
Copy link

I am running into this same issue as well.

@jadamsdb
Copy link

@kashifaliquazi Figured out where we went wrong. You're passing in a document_client to the GeoDataManagerConfiguration function. It needs to be a DynamoDb object.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants