Call MongoDB Stored Javascript Function in C# .Net

前端 未结 1 983
遇见更好的自我
遇见更好的自我 2021-01-20 03:32

I need to call a MongoDB Stored JavaScript Function in C# Code.

My Stored JavaScript Function GetUserInfo

function() {
    return db         


        
1条回答
  •  攒了一身酷
    2021-01-20 04:29

    You can use the RunCommand method to execute the eval command. We've removed it from the API itself because we don't want you using it. Have a look at these sections for why you shouldn't be using eval, first and second.

    I'd highly suggest you rethink your "stored procedure" strategy. While I applaud your efforts to centralize and DRY your code, eval in MongoDB will kill performance and concurrency.

    0 讨论(0)
提交回复
热议问题