1

We are using mongodb & MongoJack for mapping our collections. There is a need where we need to create composite primary key. We are not getting correct configuration how to use @Id annotation.

Can anyone help in this or should we avoid using mapper for the same?

MongoDB Composite Key link tells what we want to do . But we want this through mongojack..

Community
  • 1
  • 1
Raichu
  • 117
  • 1
  • 11

1 Answers1

1

Below syntax should work. Note replacing String class with your Key class

private static JacksonDBCollection<Test, TestKey> coll = MongoDB.getCollection("test", Test.class, TestKey.class);
ad-inf
  • 1,520
  • 4
  • 30
  • 53