Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot Save a Bool in CosmosDB #953

Open
zachary22321 opened this issue Feb 2, 2023 · 0 comments
Open

Cannot Save a Bool in CosmosDB #953

zachary22321 opened this issue Feb 2, 2023 · 0 comments

Comments

@zachary22321
Copy link

Describe the bug
When I try to save a bool in cosmosDB it does not save to the database. However, if I add another property with bool? then both that new property and the bool property saved. I then tried to remove the bool? property and the value no longer saved again. I also tried to change the property from bool to bool? but it did not save.

To Reproduce
Here is my class. There is a serializable on it, but that was just for troubleshooitng, it was not saving without that as well.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Newtonsoft.Json;

namespace Budget.Web.Model
{
public class Item
{
public Item()
{
id = Guid.NewGuid().ToString();
}

    public string id { get; set; }
   // public Account[] accounts { get; set; }

    public string userId { get; set; }
    
    [JsonProperty("closedInPlaid")]
    public bool? ClosedInPlaid { get; set; }
    public string plaidId { get; set; }

    public string plaidInstitutionId { get; set; }

    public string plaidAccessToken { get; set; }

    public DateTime? plaidLastSuccessfulTransactionsUpdate { get; set; }

    public DateTime? plaidLastfailedTransactionsUpdate { get; set; }

    public DateTime? lastImport { get; set; }
    public DateTime? lastImportAttempt { get; set; }
    public DateTime? lastFailedImport { get; set; }
    public string lastFailedImportException { get; set; }

    public string name { get; set; }
    

}

}

Expected behavior
Theh bool or bool? property called public bool? ClosedInPlaid { get; set; } should save in the database.

Actual behavior
It does not save

Environment summary

SDK Version:
OS Version (e.g. Windows, Linux, MacOSX):
MAC M1 Mini
Rider
Mac Monterey 12.6.2
C#
Microsoft.Azure.Cosmos/3.31.2

Additional context

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant