MongoDb Output - How to Write Array fields/values in a collection?
Hello, I have a need to write string arrays into a mongodb collection and I am using Talend Big Data and the components that come with that. However, I do not see any option to define the output field as an array. Is writing to array possible? Example: This is the key/value format I need in my collection. search_key:
Re: MongoDb Output - How to Write Array fields/values in a collection?
Thank you. This is good insight. However, I am getting the value of NULL now. Here is what I am doing: tMongodbConnection --> SQLInput --> tjavaflex --> tmap --> tMongoOutput tjavaflex: Start: // start part of your Java code java.util.ArrayList list1 = new java.util.ArrayList();
Main: list1.add("hello"); list1.add("there"); list1.add("test"); globalMap.put("latlong", list1); ------------------- Then in tmap, I on right side, I have: column: latlongtest, type: list, Expression: (java.util.ArrayList)globalMap.get("latlong")
I also tried entering (java.util.ArrayList)globalMap.get("latlong") in the Variable section but still getting NULL in mongodb. latlongtest is defined as list in mongodb schema. Please help as my project is due on Monday. Thanks.