命比纸薄

文章 评论 浏览 29

命比纸薄 2025-02-20 15:29:00

1)常规

  • 避免“很难编写,因此应该很难读取”代码
  • 在函数开始时添加变量声明,而不是在代码中间(wdeclaration-terter-sattatement)
  • 使用C ++注释
  • 请勿使用API​​函数mysql_set_character_set()
  • 编写正确的错误处理,包括mysql_error/mysql_stmt_error结果,请不要 。错误后继续执行后续代码。
  • 始终初始化mysql_bind

2)输入绑定缓冲区

  • U. Indicator用于批量操作,在这里不需要
  • bind.is_null 注释)

3)输出绑定缓冲区

  • 在mysql_stmt_execute()之后始终绑定输出参数,因为MySQL_STMT_PREPARE不能总是确定参数数量,例如调用存储过程时:在这种情况下,MySQL_STMT_BIND_PARAM将返回错误。
  • 则绑定错误指示器没有多大意义

如果不设置mysql_report_data_truncation(mysql_optionsv) , -Connector-C/Tree/3.3/Unitest/libmariaDB“ rel =“ nofollow noreferrer”> Mariadb连接器/C单元测试

1) General

  • Avoid "it was hard to write, so it should be hard to read" code
  • add variable declarations at the beginning of the function, not in the middle of code (Wdeclaration-after-statement)
  • don't use c++ comments in C
  • set character set with api function mysql_set_character_set()
  • write proper error handling, including mysql_error/mysql_stmt_error results and don't continue executing subsequent code after error.
  • always initialize MYSQL_BIND

2) input bind buffer

  • u.indicator is used for bulk operations and doesn't make sense here
  • bind.is_null is not required, since you specified a valid buffer address
  • buffer_length is not set (in comments)

3) Output bind buffer

  • Always bind output parameters after mysql_stmt_execute(), since mysql_stmt_prepare can't always determine the number of parameters, e.g. when calling a stored procedure: In this case mysql_stmt_bind_param will return an error.
  • binding an error indicator doesn't make much sense without setting MYSQL_REPORT_DATA_TRUNCATION (mysql_optionsv)

For some examples how to deal with prepared statements check the file ps.c of MariaDB Connector/C unit tests

可以通过MariaDB Connect/c准备的语句通过transmate字符串

命比纸薄 2025-02-20 11:18:38

由于您正在阅读由带有多指数列的数据框架生产的CSV文件,因此在将其读回数据框架中时必须考虑到这一点。

尝试以下内容:

from pandas_datareader import data as pdr
import yfinance as yf
yf.pdr_override()

tickers = "MYM=F M6A=F"
hist_data = pdr.get_data_yahoo(
    tickers, period="1mo", interval="5m", prepost=True, group_by="ticker"
)

# Writing to csv-file
hist_data.to_csv("hist_data.csv")

# Reading back from csv-file
hist_data = pd.read_csv("hist_data.csv", index_col=0, header=[0, 1])

# Selecting the M6A=F/Volume-column:
volume = hist_data[[("M6A=F", "Volume")]]
print(volume)

第一个更改是使用index_col = 0设置索引列(显然是第一个)。第二,header = [0,1]是确保使用前2行用于构建多索引列。参见在这里

标题 int,int列表,none,默认'ceble'

...标题可以是指定列上多指数的行位置的整数列表...

结果:(

                           M6A=F
                          Volume
Datetime                        
2022-06-06 09:40:00-04:00    0.0
2022-06-06 09:45:00-04:00   67.0
2022-06-06 09:50:00-04:00   36.0
2022-06-06 09:55:00-04:00   18.0
2022-06-06 10:00:00-04:00   61.0
...                          ...
2022-07-06 09:20:00-04:00   47.0
2022-07-06 09:25:00-04:00   12.0
2022-07-06 09:30:00-04:00    7.0
2022-07-06 09:31:10-04:00    0.0
2022-07-06 09:31:20-04:00    NaN

[6034 rows x 1 columns]

我在此处使用了双括号hist_data [[[(“ m6a = f”,“ volume”)]获取显示显示的数据框列标签。如果您不需要,请使用单个括号hist_data [(“ m6a = f”,“卷”)]等)

Since you're reading a csv-file that was produced from a dataframe with multi-index columns, you have to take that into account when reading it back into a dataframe.

Try something like the following:

from pandas_datareader import data as pdr
import yfinance as yf
yf.pdr_override()

tickers = "MYM=F M6A=F"
hist_data = pdr.get_data_yahoo(
    tickers, period="1mo", interval="5m", prepost=True, group_by="ticker"
)

# Writing to csv-file
hist_data.to_csv("hist_data.csv")

# Reading back from csv-file
hist_data = pd.read_csv("hist_data.csv", index_col=0, header=[0, 1])

# Selecting the M6A=F/Volume-column:
volume = hist_data[[("M6A=F", "Volume")]]
print(volume)

The first change is to set an index column by using index_col=0 (obviously the first here). And the second, header=[0, 1], is to make sure that the first 2 rows are used to build the multi-index columns. See here:

header : int, list of int, None, default ‘infer’

... The header can be a list of integers that specify row locations for a multi-index on the columns ...

Result:

                           M6A=F
                          Volume
Datetime                        
2022-06-06 09:40:00-04:00    0.0
2022-06-06 09:45:00-04:00   67.0
2022-06-06 09:50:00-04:00   36.0
2022-06-06 09:55:00-04:00   18.0
2022-06-06 10:00:00-04:00   61.0
...                          ...
2022-07-06 09:20:00-04:00   47.0
2022-07-06 09:25:00-04:00   12.0
2022-07-06 09:30:00-04:00    7.0
2022-07-06 09:31:10-04:00    0.0
2022-07-06 09:31:20-04:00    NaN

[6034 rows x 1 columns]

(I've used double brackets here hist_data[[("M6A=F", "Volume")]] to get a dataframe that shows the column label. If you don't need that, use single brackets hist_data[("M6A=F", "Volume")] etc.)

当列具有相同名称时,尝试使用pd.read_csv读取和过滤列的问题

命比纸薄 2025-02-20 09:00:55

最好的方法是拍摄绝对图像并根据需要控制它。

这样: tailwind play play link

The best way to do this is to take an absolute image and control it as you want.

Like this: Tailwind Play Link

深色背景图像(不透明度?)

命比纸薄 2025-02-20 06:55:00

get.context! get.context作为buildContext

Get.context! or Get.context as BuildContext

我如何在GetX颤动中获得BuildContext?

命比纸薄 2025-02-20 05:52:57

r“ ...”是指 raw String 在Python中,这只是意味着将Backlash \视为字面而不是逃生字符。

(_ | - )[+] 正则表达式 匹配包含一个或多个的字符串 -_字符。

  • (_ | - ) 表示匹配包含的字符串-_
  • + 表示匹配上面的字符(-_),比字符串中的一次或多次匹配。

如果您不能将re库用于此解决方案:

def to_camel_case(text):
    # Since delimiters can have 2 possible answers, let's simplify it to one.
    # In this case, I replace all `_` characters with `-`, to make sure we have only one delimiter.
    text = text.replace("_", "-") # the_big-red_apple => the-big-red-apple
    
    # Next, we should split our text into words in order for us to iterate through and modify it later.
    words = text.split("-") # the-big-red-apple => ["the", "big", "red", "apple"]

    # Now, for each word (except the first word) we have to turn its first character to uppercase.
    for i in range(1, len(words)):
        # `i`start from 1, which means the first word IS NOT INCLUDED in this loop.
        word = words[i]
        
        # word[1:] means the rest of the characters except the first one
        # (e.g. w = "apple" => w[1:] = "pple")
        words[i] = word[0].upper() + word[1:].lower()
        # you can also use Python built-in method for this:
        # words[i] = word.capitalize()

    # After this loop, ["the", "big", "red", "apple"] => ["the", "Big", "Red", "Apple"]

    # Finally, we put the words back together and return it
    # ["the", "Big", "Red", "Apple"] => theBigRedApple
    return "".join(words)


print(to_camel_case("the_big-red_apple"))

r"..." refers to Raw String in Python which simply means treating backlash \ as literal instead of escape character.

And (_|-)[+] is a Regular Expression that match the string containing one or more - or _ characters.

  • (_|-) means matching the string that contains - or _.
  • + means matching the above character (- or _) than occur one or more times in the string.

In case you cannot use re library for this solution:

def to_camel_case(text):
    # Since delimiters can have 2 possible answers, let's simplify it to one.
    # In this case, I replace all `_` characters with `-`, to make sure we have only one delimiter.
    text = text.replace("_", "-") # the_big-red_apple => the-big-red-apple
    
    # Next, we should split our text into words in order for us to iterate through and modify it later.
    words = text.split("-") # the-big-red-apple => ["the", "big", "red", "apple"]

    # Now, for each word (except the first word) we have to turn its first character to uppercase.
    for i in range(1, len(words)):
        # `i`start from 1, which means the first word IS NOT INCLUDED in this loop.
        word = words[i]
        
        # word[1:] means the rest of the characters except the first one
        # (e.g. w = "apple" => w[1:] = "pple")
        words[i] = word[0].upper() + word[1:].lower()
        # you can also use Python built-in method for this:
        # words[i] = word.capitalize()

    # After this loop, ["the", "big", "red", "apple"] => ["the", "Big", "Red", "Apple"]

    # Finally, we put the words back together and return it
    # ["the", "Big", "Red", "Apple"] => theBigRedApple
    return "".join(words)


print(to_camel_case("the_big-red_apple"))

python挑战将绳子转换为骆驼

命比纸薄 2025-02-20 01:41:19

这里的一行解决方案:

find *.txt | sed -E 'p;s/[, ]+/_/g' | tr '\n' '\0' | xargs -0 -n2 mv

这是一个非常有用的命令模板,用于重命名文件:

find ... | sed 'p;s/...' | tr '\n' '\0' | xargs -0 -n2 mv

One line solution here:

find *.txt | sed -E 'p;s/[, ]+/_/g' | tr '\n' '\0' | xargs -0 -n2 mv

This is a very useful command template for batch renaming files:

find ... | sed 'p;s/...' | tr '\n' '\0' | xargs -0 -n2 mv

使用bash脚本更改文件名:通过下划线替换逗号和空格

命比纸薄 2025-02-20 00:59:42

手动链接已从React-Native 0.69中删除,有利于自动链接功能,因此现在您可以在本机模块中链接您的资产,否则您可以使用
react-nortiative-asset

剩下的步骤与板条箱中的crate相同

react-native.config.js

module.exports = {
    project: {
        ios: {},
        android: {}
    },
    assets: ['./src/assets/'],
};

安装下面的React-Native-Asset运行下方

yarn react-native-asset or npx react-native-asset

manual linking has been removed from react-native 0.69 in favour of autolinking feature so now you have link your assets in native module or else you can use
react-native-asset

remaining steps are same as before crate a file in root directory of project

react-native.config.js

module.exports = {
    project: {
        ios: {},
        android: {}
    },
    assets: ['./src/assets/'],
};

after installing react-native-asset run below command

yarn react-native-asset or npx react-native-asset

无法识别的命令“链接”在链接反应本机中的字体时

命比纸薄 2025-02-19 18:32:38

问题是您在仍在循环的同时修改了while循环条件,并且在索引增加之前进行了变量分配。

description = logs[descriptionLine++];

这使得循环检查使用当前迭代的描述内容时,请检查上一行内容的状态。

让我们假设您的logs []是由这3行制成的,我们以DescriptionLine = 0开始:

line 0: blah blah at blah
line 1: blah blah at blah
line 2: something else

现在,

description = logs[0] // "line 0: blah blah at blah"

让我们查看while循环条件:

while (description.Contains("at") || description.Contains("---")) { ... }

条件得到满足,因为描述暂时包含“ at”一词,我们进入循环正文:

description = logs[descriptionLine++];

推迟++您使用的增量操作员使Descript> DescriptionLine变量>变量评估首先然后增加。这意味着描述变量的分配是 descript> descriptionline值从01 。

现在(这很重要),我们以 不变 描述的方式离开了第一个循环。当我们启动第二个迭代时,description的值仍然相同,因此我们进入了循环主体,但是DescriptionLine值已从0 < /代码> 1。推迟++增量运算符再次使技巧重新解决:

description = logs[1] // "line 1: blah blah at blah"

但是当我们离开循环时,descriptionline是2。最后,我们进入了第三和最后一个迭代

while (description.Contains("at") || description.Contains("---"))

Description“第1行:Blah blah in Blah”,我们进入了身体,但我们处于第三次迭代,我们不应该进入!相反,这发生了:

description = logs[2] // "line 2: something else"

我们进行了另一个分配,因为现在Descriptline已从1 2 增加。

The problem is you modify the while loop condition while still looping, and the variable assignment is made before the index increment.

description = logs[descriptionLine++];

This makes the loop check for the condition of the previous line content while modifying the content of description with the current iteration.

Let's suppose your logs[] is made of these 3 simple lines and we start with descriptionLine = 0:

line 0: blah blah at blah
line 1: blah blah at blah
line 2: something else

now,

description = logs[0] // "line 0: blah blah at blah"

Let's see the while loop condition:

while (description.Contains("at") || description.Contains("---")) { ... }

The condition is satisfied because description momentarily contains the word "at", and we get in the loop body:

description = logs[descriptionLine++];

The postponed ++ increment operator you used makes the descriptionLine variable evaluated first and then incremented. This means that the assignment to the description variable is made before the descriptionLine value is incremented from 0 to 1.

Now (this is important) we get out of the first loop into the second with an unchanged description. When we start the second iteration, the value of description is still the same so we get into the loop body, but the descriptionLine value had been incremented from 0 to 1. The postponed ++ increment operator makes the trick again:

description = logs[1] // "line 1: blah blah at blah"

but when we get out of the loop, descriptionLine is 2. Finally, we get into the third and last iteration

while (description.Contains("at") || description.Contains("---"))

description is "line 1: blah blah at blah", we get into the body but we're at the third iteration, we shouldn't have gotten in! Instead, this happens:

description = logs[2] // "line 2: something else"

We make another assignment, since now descriptionLine has been incremented from 1 to 2.

c#cy可以在while循环之外获取变量的值

命比纸薄 2025-02-18 21:25:08

我找到了解决方案。我验证了完整的实体,并查看了验证器中的对象,并找到了完整的实体。

当我考虑如何测试时,我进行了一些研究,并发现了其他相同的测试。我不知道这是否是最好的解决方案,但是我现在可以编写测试。

CondectValidatTestCase

<?php
    
namespace App\Tests\Validator\Constraint;

use App\Entity\Entity;
use App\Validator\MinimumAmount;
use App\Validator\MinimumAmountValidator;
use Symfony\Component\Validator\Context\ExecutionContext;
use Symfony\Component\Validator\Test\ConstraintValidatorTestCase;
use Symfony\Component\Validator\Validator\ValidatorInterface;
use Symfony\Contracts\Translation\TranslatorInterface;
use Symfony\Component\Validator\Context\ExecutionContextInterface;
use Symfony\Component\Validator\ConstraintValidatorInterface;

class MinimumAmountValidatorTest extends ConstraintValidatorTestCase
{
   /**
   * @var ExecutionContextInterface
   */
   protected $context;

    /**
    * @var ConstraintValidatorInterface
    */
    protected $validator;

    /**
    * @var Constraint
    */
    protected $constraint;

    protected function setUp(): void
    {
        $this->constraint = new Entity();
        $this->context = $this->createContext();
        $this->validator = $this->createValidator();
        $this->validator->initialize($this->context);
    }

    public function createValidator(): MinimumAmountValidator
    {
        return new MinimumAmountValidator();
    }

    public function createContext(): ExecutionContext
    {
        $myEntity = new Entity();
        $myEntity->setCurrency('EUR');

        $translator = $this->createMock(TranslatorInterface::class);
        $translator->expects($this->any())->method('trans')->willReturnArgument(0);
        $validator = $this->createMock(ValidatorInterface::class);

        $executionContext = new ExecutionContext($validator, $myEntity, $translator);
        $context->setNode('InvalidValue', null, null, 'property.path');
        $context->setConstraint($this->constraint);
        return $executionContext;
    }


    public function testValidation()
    {
        $this->validator->validate(40.00, new  MinimumAmount());
        $this->assertNoViolation();
    }
}
 

约束

<?php

namespace App\Validator;

use Symfony\Component\Validator\Constraint;

/**
 * @Annotation
 */
class MinimumAmount extends Constraint
{
    /**
     * @var string
     */
    public $message = '';

    /**
     * @return string
     */
    public function validatedBy(): string
    {
        return MinimumAmountValidator::class;
    }
}

验证器

<?php

namespace App\Validator;

use App\Entity\Entity;
use Symfony\Component\Validator\Constraint;
use Symfony\Component\Validator\ConstraintValidator;

class MinimumAmountValidator extends ConstraintValidator
{
    /**
     * @param float $value
     * @param Constraint $constraint
     *
     * @return void
     */
    public function validate($value, Constraint $constraint)
    {
        /**
         * @var Entity
         */
        $contextRoot = $this->context->getRoot();
        $currency = $contextRoot->getCurrency(); // EUR
        $amount = $value; // 40.00

        // Validation implementation

    }
}

I have found a solution. I validated the complete entity and looked at the object in the validator and found the complete entity.

When I thought about how to test it, I did some research and found other tests that did the same. I don't know if this is the best solution, but I can now write my tests.

ConstraintValidatorTestCase

<?php
    
namespace App\Tests\Validator\Constraint;

use App\Entity\Entity;
use App\Validator\MinimumAmount;
use App\Validator\MinimumAmountValidator;
use Symfony\Component\Validator\Context\ExecutionContext;
use Symfony\Component\Validator\Test\ConstraintValidatorTestCase;
use Symfony\Component\Validator\Validator\ValidatorInterface;
use Symfony\Contracts\Translation\TranslatorInterface;
use Symfony\Component\Validator\Context\ExecutionContextInterface;
use Symfony\Component\Validator\ConstraintValidatorInterface;

class MinimumAmountValidatorTest extends ConstraintValidatorTestCase
{
   /**
   * @var ExecutionContextInterface
   */
   protected $context;

    /**
    * @var ConstraintValidatorInterface
    */
    protected $validator;

    /**
    * @var Constraint
    */
    protected $constraint;

    protected function setUp(): void
    {
        $this->constraint = new Entity();
        $this->context = $this->createContext();
        $this->validator = $this->createValidator();
        $this->validator->initialize($this->context);
    }

    public function createValidator(): MinimumAmountValidator
    {
        return new MinimumAmountValidator();
    }

    public function createContext(): ExecutionContext
    {
        $myEntity = new Entity();
        $myEntity->setCurrency('EUR');

        $translator = $this->createMock(TranslatorInterface::class);
        $translator->expects($this->any())->method('trans')->willReturnArgument(0);
        $validator = $this->createMock(ValidatorInterface::class);

        $executionContext = new ExecutionContext($validator, $myEntity, $translator);
        $context->setNode('InvalidValue', null, null, 'property.path');
        $context->setConstraint($this->constraint);
        return $executionContext;
    }


    public function testValidation()
    {
        $this->validator->validate(40.00, new  MinimumAmount());
        $this->assertNoViolation();
    }
}
 

Constraint

<?php

namespace App\Validator;

use Symfony\Component\Validator\Constraint;

/**
 * @Annotation
 */
class MinimumAmount extends Constraint
{
    /**
     * @var string
     */
    public $message = '';

    /**
     * @return string
     */
    public function validatedBy(): string
    {
        return MinimumAmountValidator::class;
    }
}

Validator

<?php

namespace App\Validator;

use App\Entity\Entity;
use Symfony\Component\Validator\Constraint;
use Symfony\Component\Validator\ConstraintValidator;

class MinimumAmountValidator extends ConstraintValidator
{
    /**
     * @param float $value
     * @param Constraint $constraint
     *
     * @return void
     */
    public function validate($value, Constraint $constraint)
    {
        /**
         * @var Entity
         */
        $contextRoot = $this->context->getRoot();
        $currency = $contextRoot->getCurrency(); // EUR
        $amount = $value; // 40.00

        // Validation implementation

    }
}

函数测试验证器:与其他属性进行比较

命比纸薄 2025-02-18 11:25:57

假设您有一个类classa,其中包含方法methoda定义为:

class ClassA:
    def methodA(self, arg1, arg2):
        ... # do something

objecta是此类的实例。

现在,当调用objecta.methoda(arg1,arg2)时,python内部将其转换为:

ClassA.methodA(objectA, arg1, arg2)

self变量涉及对象本身。

Let's say you have a class ClassA which contains a method methodA defined as:

class ClassA:
    def methodA(self, arg1, arg2):
        ... # do something

and objectA is an instance of this class.

Now when objectA.methodA(arg1, arg2) is called, python internally converts it for you as:

ClassA.methodA(objectA, arg1, arg2)

The self variable refers to the object itself.

“自我”参数的目的是什么?为什么需要它?

命比纸薄 2025-02-18 02:17:33

这很简单,不用担心。您需要使用骗局(单个组件角模块)。下面为您提供的一个示例:

创建模块,仅导出一个组件! - 这是非常重要的

@NgModule({
  declarations: [ModuleAComponent],
  exports: [ModuleAComponent],
  imports: [
    ButtonModule // etc
  ],
})
export class ModuleA {}

模块中的进口模块 - 请参阅,这很简单

@NgModule({
  declarations: [ModuleBComponent],
  exports: [ModuleBComponent],
  imports: [
    ModuleB
  ],
})
export class ModuleB {}

This is pretty simple, don't worry. You need to use a SCAM (Single Component Angular Module). An example for you is below:

Create your module, only export one component! - this is very important

@NgModule({
  declarations: [ModuleAComponent],
  exports: [ModuleAComponent],
  imports: [
    ButtonModule // etc
  ],
})
export class ModuleA {}

Import ModuleA in an ModuleB - see, it's simple

@NgModule({
  declarations: [ModuleBComponent],
  exports: [ModuleBComponent],
  imports: [
    ModuleB
  ],
})
export class ModuleB {}

为什么要从一个模块中导出组件&amp;在另一个模块组件中使用

命比纸薄 2025-02-17 10:16:07

我认为它的10,虽然不确定。

视图限制为10,因此,如果相同,则有意义。

I think its 10, not quite sure though.

The view limit is 10 so it'd make sense if it was the same.

在世界图中,杂货店是否有限制?

命比纸薄 2025-02-17 01:58:12

该代码具有混合同步和异步命令,这是有问题的。

您可以使用jQuery多个选择器(例如所有有条件测试)更轻松地进行操作

cy.get('createApplicationReferencesPresent,createApplicationNoReferencesPresent')
  .then($els => {
    const numberOfElements = $els.length  // 1 or 2 - fails if neither present
  })

,仅当页面稳定时才有效。

The code has mixed synchronous and asynchronous commands, which is problematic.

You can more easily do it with jQuery multiple selectors

cy.get('createApplicationReferencesPresent,createApplicationNoReferencesPresent')
  .then($els => {
    const numberOfElements = $els.length  // 1 or 2 - fails if neither present
  })

Like all conditional testing, it only works if the page is stable.

柏树测试正在计时

命比纸薄 2025-02-15 18:45:08

我不确定您为什么要从堆栈继承而来,但是您对超级效力的问题非常简单。您应该使用 super.pop() [调用父级方法],而不是 this.pop() [调用此方法==递归调用]

    @Override
public MyItem pop() {
    if (this.isEmpty()) {
        return null;
    }
    pops++;
    return super.pop();
}

I'm not sure why you want inherit from Stack but your problem with overriding is quite simple. You should use super.pop() [calls parent method] instead of this.pop() [calls this method == recursive call]

    @Override
public MyItem pop() {
    if (this.isEmpty()) {
        return null;
    }
    pops++;
    return super.pop();
}

覆盖Java堆栈类的方法

命比纸薄 2025-02-15 16:35:02

我目前有一个Raspberry Pi 4运行Ubuntu-22.04.2,我设法与MongoDB进行了适当的安装。

系统更新:

sudo apt-get update
sudo apt-get upgrade

需要安装libss1.1之前安装mongoDB:

sudo wget http://ports.ubuntu.com/ubuntu-ports/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2.18_arm64.deb
sudo dpkg -i libssl1.1_1.1.1f-1ubuntu2.18_arm64.deb
sudo apt-get update

mongoDB:

wget -qO - https://www.mongodb.org/static/pgp/server-4.4.asc | sudo apt-key add -
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list
sudo apt-get update
sudo apt-get install mongodb-org=4.4.8 mongodb-org-server=4.4.8 mongodb-org-shell=4.4.8 mongodb-org-mongos=4.4.8 mongodb-org-tools=4.4.8

检查已安装版本:

mongod --version

启动Mongod:

sudo systemctl restart mongod
sudo systemctl status mongod

如果启动良好

sudo apt-mark hold mongodb-org*

安装

I currently have a Raspberry pi 4 running Ubuntu-22.04.2 and I managed to get a proper installation with mongodb.

System update :

sudo apt-get update
sudo apt-get upgrade

Required installation of libss1.1 before installing mongodb :

sudo wget http://ports.ubuntu.com/ubuntu-ports/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2.18_arm64.deb
sudo dpkg -i libssl1.1_1.1.1f-1ubuntu2.18_arm64.deb
sudo apt-get update

Installing mongodb :

wget -qO - https://www.mongodb.org/static/pgp/server-4.4.asc | sudo apt-key add -
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list
sudo apt-get update
sudo apt-get install mongodb-org=4.4.8 mongodb-org-server=4.4.8 mongodb-org-shell=4.4.8 mongodb-org-mongos=4.4.8 mongodb-org-tools=4.4.8

Checking the installed version :

mongod --version

Launch of mongod :

sudo systemctl restart mongod
sudo systemctl status mongod

If it is well launched you can block the version of mongodb in 4.4.8 :

sudo apt-mark hold mongodb-org*

End

如何在rspberry pi 4上安装mongoDB?

更多

推荐作者

櫻之舞

文章 0 评论 0

弥枳

文章 0 评论 0

m2429

文章 0 评论 0

野却迷人

文章 0 评论 0

我怀念的。

文章 0 评论 0

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文