When storing arrays in MongoDB with Java according to an online doc, you can use anything that extends List.
So, using your example, it will look something like this:
ArrayList tags = new ArrayList();
tags.add("tag1");
tags.add("tag2");
BasicDBObject doc = new BasicDBObject(new ObjectId(), tags);
source
share