My project was build on GMONGO framework and all the domains were created with attribute id as a string.So grail frame work will create mongodb collections with _id attribute when application is app. In UI there was a limitation to retrive _id.So in service "_id" is rewrite to "id" to overcome the issue. Could we created collections with "id" by default rather than "_id"?
Related Questions in MONGODB
- MongoDb not connecting C#
- How do I link two models in mongoose?
- MERN Stack App - User Avatar Upload - 500 Error After Deployment on Render
- On the server side, it returns undefined but on the client side, logs the values no problem
- Laravel: Using belongsToMany relationship with MongoDB
- What are some MERN projects that will grow me from junior dev to senior
- Save Interface in DB golang
- findOneAndUpdate not updating value in mongodb?
- Get Type Error when using .countDocuments with mongoDB
- Getting a Large Error Output When Calling MongoDB/Mongoose Functions Without an Error Message
- How to enter data in mongodb array at specific position such that if there is only 2 data in array and I want to insert at 5, then rest data is null
- using Python to insert_one to my mongo_db, How do I pass key values into a function?
- SSL Certificate Verification Error When Scraping Website and Inserting Data into MongoDB
- connect ECONNREFUSED 43.205.72.30:27017 while connecting to Atlas
- Vite is probably changing my import path. What should I do?
Related Questions in GRAILS
- Table UserRole not populated in Grails 6
- Grails run-app or grails compile is not working with 6..0.0( java 11 or 17)
- Hibernate OptimisticLocking(type = OptimisticLockType.DIRTY) not working
- HibernateOptimisticLockingFailureException in Groovy / Grails, how to proceed after recovry
- Grails with Spring Security: How do I keep a password history to prevent password reuse
- How can I configure a Grails application using the Spring Security Rest plugin to authenticate with Amazon Cognito
- Grails - Problem to Exclude a Filter from Specific Endpoints
- Why are my beans disabled onStartUp after upgrading to grails5?
- Getting error on upgrading mysql 8 with grails 2.4.3
- get XFF using angular
- how to compare to collections of map in groovy
- Grail/GORM Data Service @Query - Join with Multiple Conditions
- Build Grails project with specific environment
- Grails params in controller empty on too large post request
- Grails5 upgrade - hibernate now returning a hibernate proxy instead of actual object - why?
Related Questions in GORM-MONGODB
- Version property missing when converting Domain to JSON
- Grails MongoDB plugin: Values in v:2 index key pattern cannot be of type bool
- Mapping of Dynamic fields in RestfulController POST (save) method
- Grails 3.1 - Can't find codec for domain class
- Grails update embedded object but no encoding password using spring security
- Grails MongoDB Dirty Checking Fails With Spring Security
- how to hook gorminstance api in grail 3.x
- IllegalStateException when trying to query a MongoDB domain class using Grails 2.3.7
- Grails 3 & relational domain mapping with Mongo
- Grails v3.1.4 specify encrypted password for mongodb connection
- Is there a replacement for GMongo in the Grails Gorm-MongoDB Plugin?
- Unable to save embedded objects in mongodb using gorm(typeMismatch error)
- Abstract domain class and tablePerHierarchy
- How to create mongodb collection without _id
- A component required a bean named 'dataSource_dbCreate' that could not be found
Related Questions in GMONGO
- Groovy gmongo batch processing
- Multiple insert into mongodb - only the first collection gets updated
- Is there a replacement for GMongo in the Grails Gorm-MongoDB Plugin?
- Create a mongo connection and make it alive for execution of an Entire Test Suite in Ready!API
- How to create mongodb collection without _id
- How to intercept and log mongodb queries?
- doEval() With Multiline String Argument
- Mongo CursorNotFound exception in active cursor via Grails domain criteria
- GMongo search within an embedded json in an object
- gmongo MapReducer with Finalizer
- can I use mongdb plugin and gmongo together in grails project?
- Gmongo date query
- mongodb gmongo runCommand
- Calculate distance in MongoDB is not accurate
- Do GORM / GMongo wrap collections to accept Maps? (Grails / GMongo internals.)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Popular Tags
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
No you cant. Mongo will automaticaly create _id if you dont specify any.
https://docs.mongodb.com/v3.2/reference/glossary/
In your case you can add
indextoidfield, and when run queries just add projection to exclude _id.So you will have something like this in data
{_id: mongoDbID, id: yourId, ...}And run query like this
collection.find({id: yourId}).project({_id: 0}).toArray();You will get this as an result
{id: yourId, ...}Hope this helps.