coronabytes / dotnet-arangodb-extensions Goto Github PK
View Code? Open in Web Editor NEWSerilog, DevExtreme and DataProtection extensions for .NET ArangoDB driver
License: MIT License
Serilog, DevExtreme and DataProtection extensions for .NET ArangoDB driver
License: MIT License
hi we need a management page for features
I'm testing Devextreme extension with a dxDataGrid and filtering and sorting operations only works with key field, not working with other fields
This is the dxDataGrid
@(Html.DevExtreme().DataGrid()
.ShowBorders(true)
.DataSource(d => d.Mvc().Controller("SampleData").LoadAction("Get").Key("_id"))
.Columns(columns => {
columns.Add().DataField("_key");
columns.Add().DataField("name");
columns.Add().DataField("population");
columns.Add().DataField("isCapital");
})
.Paging(p => p.PageSize(10))
.FilterRow(f => f.Visible(true))
.HeaderFilter(f => f.Visible(true))
.RemoteOperations(true)
This is my api
[Route("api/[controller]")]
public class SampleDataController : Controller {
[HttpGet]
public async Task<object> Get(DataSourceLoadOptions loadOptions) {
// from connection string
var arango = new ArangoContext("Server=http://localhost:8529;User=root;Password=12345678a.;");
ArangoHandle db = new ArangoHandle("TEST");
var arangoTransform = new ArangoTransform(loadOptions, Transform);
if (!arangoTransform.Transform(out var error))
return BadRequest(error);
var data= await arangoTransform.ExecuteAsync<City>(arango, db, "germanCity");
return data;
//return DataSourceLoader.Load(SampleData.Orders, loadOptions);
}
private static readonly ArangoTransformSettings Transform = new ArangoTransformSettings
{
IteratorVar = "x",
Key = "key",
//Filter = "x.Active == true",
};
public class Geometry
{
public string type { get; set; }
public List<double> coordinates { get; set; }
}
public class City
{
public string _key { get; set; }
public string _id { get; set; }
public string _rev { get; set; }
public string name { get; set; }
public int population { get; set; }
public bool isCapital { get; set; }
public Geometry geometry { get; set; }
}
}
this is my collection data
[{"_key":"Berlin","_id":"germanCity/Berlin","_rev":"_e_x6lZm---","name":"Berlin","population":3000000,"isCapital":true,"geometry":{"type":"Point","coordinates":[13.3833,52.5167]}},{"_key":"Hamburg","_id":"germanCity/Hamburg","_rev":"_e_x63Wi---","name":"Hamburg","population":1000000,"isCapital":false,"geometry":{"type":"Point","coordinates":[10.0014,53.5653]}},{"_key":"Cologne","_id":"germanCity/Cologne","_rev":"_e_x7HEi---","name":"Cologne","population":1000000,"isCapital":false,"geometry":{"type":"Point","coordinates":[6.9528,50.9364]}}]
Hi,
Can you please add JsonProperty and JsonPropertyName attributes to properties on the DxLoadResult class, just as they exist in DxGroupResult?
Thanks
ArangoSerilogSink doesn't match the example anymore
batchPostingLimit: 50, TimeSpan.FromSeconds(2)
aren't part of the ctor anymore, and when removed
you get : cannot convert from 'Core.Arango.Serilog.ArangoSerilogSink' to 'Serilog.Core.ILogEventSink'
I have a Migration written. When an error is thrown (Because the Database does not exist, or a Schema item fails to match), it should be throwing an Exception. Instead, the error seems to be swallowed up and it deadlocks
.
Collection = new ArangoCollection
{
Name = "node_objects",
Type = ArangoCollectionType.Document,
KeyOptions = new ArangoKeyOptions()
{
AllowUserKeys = true,
Type = ArangoKeyType.Traditional
},
Schema = new ArangoSchema()
{
Rule = new {
properties = new {
DBRef = new { type = "number", multipleOf = 1 },
Name = new { type = "string" },
Locks = new { type = "object" },
CreationTime = new { type = "number" },
Powers = new { type = "array", items = "string" }
},
required = (string[])[nameof(SharpObject.DBRef), nameof(SharpObject.Name)]
}
}
var roomZeroObj = await migrator.Context.Document.CreateAsync(handle, "node_objects", new SharpObject
{
Name = "Room Zero",
DBRef = 0,
CreationTime = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()
});
Core.Arango.ArangoException
HResult=0x80131500
Message=[{"error":true,"errorNum":1620,"errorMessage":"schema validation failed"}]
Source=Core.Arango
StackTrace:
at Core.Arango.Transport.ArangoHttpTransport.<SendAsync>d__6`1.MoveNext()
at Core.Arango.Modules.Internal.ArangoDocumentModule.<CreateManyAsync>d__3`2.MoveNext()
at Core.Arango.Modules.Internal.ArangoDocumentModule.<CreateAsync>d__6`1.MoveNext()
at SharpMUSH.Database.Migrations.Migration_CreateDatabase.<Up>d__4.MoveNext() in D:\CSharpPennMUSH\SharpMUSH.Database\Migrations\Migration_CreateDatabase.cs:line 303
This exception was originally thrown at this call stack:
[External Code]
SharpMUSH.Database.Migrations.Migration_CreateDatabase.Up(Core.Arango.Migration.IArangoMigrator, Core.Arango.ArangoHandle) in Migration_CreateDatabase.cs
I can see the exceptions if I turn on all CLR Exceptions.
If you use a camel case json policy (or any other non default policy) on your documents, the query generated by the LINQ extensions do not generate correct queries.
For instance:
class Document
{
public string Label{get;set;} = "value"
}
Serializes to:
{ label: "value" }
and a query like: ...Where(e.Label == "value") will generate a query for "Label", not "label".
How can I use the select options? I always getting an error.
passing
{
"select": [
"x.Nombre"
]
}
I get
"Message": "Unexpected character encountered while parsing value: x. Path '', line 0, position 0.",
If i try with {
"select": [
"Nombre"
]
}
I get
"Message": "Error parsing NaN value. Path '', line 1, position 1.",
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.