How can I query AEM Data from MongoDB | Community
Skip to main content
Level 2
October 16, 2015

How can I query AEM Data from MongoDB

  • October 16, 2015
  • 2 replies
  • 4164 views

I have configured AEM with MongoDB. I wanted to Query MongoDB to fetch AEM data. 

Say I wanted to know list of products for Geometrix Website. OR Say I wanted to know all the users available inside AEM.

Is there any documentation available where I can find out - how to query AEM data from MongoDB, how it is stored and all? 

I wanted to know this because, suppose I wanted to write a Java code to insert data inside MongoDB, for adding some data or displaying some data from AEM. 

Note: I am using MongodbVUE GUI tool to access DB data. 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

2 replies

Peter_Puzanovs
Community Advisor
Community Advisor
October 16, 2015

Yeah you can view all data that used to be under repository folder and know is in your mongo database.

You can use wide range of tools to connect to your database. My choice is RoboMongo :)

However, you should not need to do that since, your access layer ideally is Sling/OAK rather then Mongo and direct search. Depends on your use case ofc.

Level 2
October 16, 2015

RoboMongo is same as MongodbVUE right? But my question is, how can I query? Can you give some sample query or link where it is explained?...

Peter_Puzanovs
Community Advisor
Community Advisor
October 16, 2015

Yes it's similar.

Can't see is being that straight forward, you can start by searching individual fields, added an example that searches for all product under nodes.

Remind you, that some of these fields might be named differently in your database(r14cf0d10fdd-0-1) is likely to have a different name.

Say I wanted to know list of products for Geometrix Website:

db.getCollection('nodes').find({ "cq:template.r14cf0d10fdd-0-1" : /geometrixx-outdoors\/templates\/page_product/})

P.S. it's much easier to execute the same search in AEM6 directly.

kautuk_sahni
Community Manager
Community Manager
October 6, 2016

Hi 

Please refer to this forums post:- 

Link:- http://help-forums.adobe.com/content/adobeforums/en/experience-manager-forum/adobe-experience-manager.topic.html/forum__alig-i_have_configuredae.html

//

    You can view all data that used to be under repository folder and know is in your mongo database.

    You can use wide range of tools to connect to your database. My choice is RoboMongo :)

   

Also please have a look this this community article:- http://cq-ops.tumblr.com/post/87307885504/useful-mongodb-commands-for-aem-6

// Useful MongoDB Commands for AEM 6

Documentation :- https://docs.adobe.com/docs/en/aem/6-2/deploy/platform/aem-with-mongodb.html

~kautuk

Kautuk Sahni