Four Stars

How to get last inserted sequence number from mongoDB

Hi, I'm trying to get last inserted sequence number from mongoDB with tJavaRow. Is it possible to get it? Any other way to get the sequence number?
Tags (1)
1 REPLY
Community Manager

Re: How to get last inserted sequence number from mongoDB

Hi
Do you want to retrieve the last inserted object Id? Using tMongoDBInput to query the _id field, Sort by _id column with Desc type and set the Limit parameter as 1.

Regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business