mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-20 02:29:39 +08:00
Update MongoDb
This commit is contained in:
@@ -71,6 +71,14 @@ namespace MongoDbTest
|
||||
var delrow = db.Deleteable(new OrderInfo() { Id = ids.Last() })
|
||||
.ExecuteCommand();
|
||||
|
||||
var delrow2 = db.Deleteable<OrderInfo>()
|
||||
.In(new string[] { ids.Last(),ids.First() })
|
||||
.ExecuteCommand();
|
||||
|
||||
var delrow3 = db.Deleteable<OrderInfo>()
|
||||
.Where(it=>it.Id==ids.Last()||it.Name=="A1")
|
||||
.ExecuteCommand();
|
||||
|
||||
var list = db.Queryable<OrderInfo>().ToDataTable();
|
||||
|
||||
var list2 = db.Queryable<OrderInfo>().Where(it=>it.Name=="a3"&&it.Price==11).ToList();
|
||||
|
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Nodes;
|
||||
|
||||
namespace SqlSugar.MongoDb
|
||||
{
|
||||
@@ -14,6 +15,11 @@ namespace SqlSugar.MongoDb
|
||||
var jsonObjects = new List<string>();
|
||||
foreach (var item in this.WhereInfos)
|
||||
{
|
||||
if (item.StartsWith("{") && item.EndsWith("}"))
|
||||
{
|
||||
jsonObjects.Add(item);
|
||||
continue;
|
||||
}
|
||||
var key = this.EntityInfo.Columns.FirstOrDefault(it => it.IsPrimarykey);
|
||||
var startWithValue = $"{Builder.GetTranslationColumnName(key.DbColumnName)} IN (";
|
||||
if (item.StartsWith(startWithValue))
|
||||
|
Reference in New Issue
Block a user