Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.

Delete a record using Mongo Query DB Tool

Parasofttoudaya
Parasofttoudaya Posts: 232 ✭✭

Team,

Facing issue in delete call using mongo query db tool. When we try to delete using db.collectionName.remove is not possible as it accepts request only json.
Please share the possible way to delete the record in mongo

Comments

  • benken_parasoft
    benken_parasoft Posts: 1,297 ✭✭✭

    As its name suggests, the "MongoDB Query Tool" is query-only. It fetches the collection with the name provided in the Collection field and will perform a "find" on the collection based on the provided query and projection arguments. No other operations on the collection are supported including things like "drop", "delete", "insert", or "update".

  • Parasofttoudaya
    Parasofttoudaya Posts: 232 ✭✭

    Same set of querying right? Why not it can be used for delete?

  • benken_parasoft
    benken_parasoft Posts: 1,297 ✭✭✭

    The tool only support the "find" operation which can only query documents from a collection object. If the "MongoDB Query Tool" was ever enhanced to perform more then just queries then we'd probably have to rename it to just "MongoDB Tool" (or something). :)

    If needed, you can use the MongoDB java API from an Extension Tool to perform whatever you need, including non-query operations. See their quick start which has code examples.

  • Parasofttoudaya
    Parasofttoudaya Posts: 232 ✭✭

    Sure.. is there anyway in near future parsoft team add this to the tool?

  • benken_parasoft
    benken_parasoft Posts: 1,297 ✭✭✭

    is there anyway in near future parsoft team add this to the tool?

    You would need to discuss with your technical representative from Parasoft.

  • Parasofttoudaya
    Parasofttoudaya Posts: 232 ✭✭

    Sure Thanks Let my soa team know this.

  • anarra
    anarra Posts: 3

    Hello, per Parasoft guidelines I tried adding MongoDB Query tool jar to my SOA Test & Virtualize 9.10 version. When I click on Add Jars button of System properties section, I see only mongo-java-driver under org.mongodb and didn't find mongo db query tool. Can someone help me adding mango db query tool to my soa test?

  • OmarR
    OmarR Posts: 235 admin
    edited June 2018

    anarra,

    Did you get a chance to restart SOAVirt after adding your mongodbquerytool.jar file to system preferences? After restart, it should appear in your tools selection when adding a new test to your test suite.

  • benken_parasoft
    benken_parasoft Posts: 1,297 ✭✭✭

    The new MongoDB Tool supports find, insert, update, and delete. It also now supports sort, skip and limit for query results.