초기 커밋.
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using MongoDB.Bson;
|
||||
using MongoDB.Driver;
|
||||
|
||||
namespace LolDataRequestLib
|
||||
{
|
||||
class DragonRequest : ARequestData
|
||||
{
|
||||
protected override void requestDataMongoDB()
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
//var subFilterGameID = Builders<BsonDocument>.Filter.Eq("RequestGameID", DataManager.getInstance().mPlatformGameID);
|
||||
|
||||
var projection =
|
||||
MongoDB.Bson.Serialization.BsonSerializer.Deserialize<BsonDocument>
|
||||
("{'eventDocument.nextDragonName' : 1, 'eventDocument.sequenceIndex' : 1, 'eventDocument.nextDragonSpawnTime' : 1}");
|
||||
|
||||
List<BsonDocument> documents = eventDataBase.GetCollection<BsonDocument>(this.mCollectionName)
|
||||
.Find(new BsonDocument()) //.Find(subFilterGameID)
|
||||
.SortByDescending(x => x["sequenceIndex"])
|
||||
.Project(projection)
|
||||
.ToList();
|
||||
|
||||
if (documents.Count == 0)
|
||||
{
|
||||
mUpdatedBsonValue = null;
|
||||
return;
|
||||
}
|
||||
|
||||
BsonDocument rtnValue = new BsonDocument();
|
||||
|
||||
foreach (BsonDocument item in documents)
|
||||
{
|
||||
rtnValue.Add(item["eventDocument"]["sequenceIndex"].ToString(), item["eventDocument"].ToBsonDocument());
|
||||
}
|
||||
rtnValue.Add("sequenceIndex", documents.First()["eventDocument"]["sequenceIndex"].ToInt32());
|
||||
|
||||
mUpdatedBsonValue = rtnValue;
|
||||
}
|
||||
catch (Exception ex) { }
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user