Inorder to populate my mongoDB i have written a java file which contains :-
private static MongoTemplate mongoTemplate
But in the line 56 mongoTemplate.save(q, “Questions” ); I am getting nullPointerException.
I have debugged and came to know that mongoTemplate is null.
How to get a bean of mongoTemplate ?