Create Composite key

Based on the business requirement we are saving a few columns at MongDb from a structured database. We want to maintain the composite key we mentioned in the structured database in Mongo as well. Here I am using Reactive Java. Is there any command which will add the key for the particular collection?