When I am trying to use lookup stage in my aggregation pipeline with Java for mongodb 4.4 (I am using free tier) , I am getting following error :
com.mongodb.MongoCommandException: Command failed with error 8000 (AtlasError): ‘pipeline is not allowed in this atlas tier’ on server mflix-shard-00-02.7jsv0.mongodb.net:27017. The full response is { “ok” : 0, “errmsg” : “pipeline is not allowed in this atlas tier”, “code” : 8000, “codeName” : “AtlasError” }
I am using the following java code :
List<? extends Bson> lookupStage = Arrays.asList(new Document(
“pipeline”,Arrays.asList(
new Document(“$match”,
new Document(“$expr”,
new Document(“$eq”,Arrays.asList(movieId,“movie_id”)))),
new Document(“$sort”,new Document(“date”,-1L)))));
I am unable to use the above mentioned method, as I am getting following error while using a pipeline:
com.mongodb.MongoCommandException: Command failed with error 8000 (AtlasError): ‘pipeline is not allowed in this atlas tier’ on server mflix-shard-00-02.7jsv0.mongodb.net:27017. The full response is { “ok” : 0, “errmsg” : “pipeline is not allowed in this atlas tier”, “code” : 8000, “codeName” : “AtlasError” }
I hope now I am able to explain the problem (in a better way ), that I am facing.
Just like the field name from and the field name as is implied by the method, I suspect that the field pipeline is also implied and should not be specified.
Just pass Arrays.asList( new Document( $match… )) rather than Arrays.asList(new Document(pipeline,…).